From 709220eb10989e86a06366ef53f5786c1d4ee087 Mon Sep 17 00:00:00 2001 From: Dima Gerasimov Date: Mon, 26 Dec 2022 13:34:24 +0000 Subject: [PATCH] build script: add watch mode --- extension/build | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/extension/build b/extension/build index 73e93ee..715cd99 100755 --- a/extension/build +++ b/extension/build @@ -20,6 +20,7 @@ TARGETS = [ def main(): p = argparse.ArgumentParser() p.add_argument('--release', action='store_true', help="Use release flavor of build") + p.add_argument('--watch' , action='store_true') p.add_argument('--lint' , action='store_true') p.add_argument('--publish', action='store_true', help="Publish on chrome web store/addons.mozilla.org") @@ -51,6 +52,14 @@ def main(): 'PUBLISH': 'YES' if args.publish else 'NO', **os.environ, } + + if args.watch: + check_call([ + 'npm', 'run', 'watch', + ], env=env, cwd=str(Path(__file__).absolute().parent)) + # TODO exec instead? + return + check_call([ 'npm', 'run', 'build', ], env=env, cwd=str(Path(__file__).absolute().parent))