aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-compiler/src/cli.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-12-19 21:11:08 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-12-19 22:41:48 +0800
commit657b698e1eba7fde2322bb81547eba26491c0af4 (patch)
tree89572e6217df07336f584d56ac0c49e6385e5601 /packages/sol-compiler/src/cli.ts
parent8ddf925a8feb41e240871fe0d57e0f40b9bb4896 (diff)
downloaddexon-sol-tools-657b698e1eba7fde2322bb81547eba26491c0af4.tar.gz
dexon-sol-tools-657b698e1eba7fde2322bb81547eba26491c0af4.tar.zst
dexon-sol-tools-657b698e1eba7fde2322bb81547eba26491c0af4.zip
Add sol-compiler watch mode
Diffstat (limited to 'packages/sol-compiler/src/cli.ts')
-rw-r--r--packages/sol-compiler/src/cli.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/packages/sol-compiler/src/cli.ts b/packages/sol-compiler/src/cli.ts
index 0a9db6e05..18cc68aaf 100644
--- a/packages/sol-compiler/src/cli.ts
+++ b/packages/sol-compiler/src/cli.ts
@@ -25,6 +25,10 @@ const SEPARATOR = ',';
type: 'string',
description: 'comma separated list of contracts to compile',
})
+ .option('watch', {
+ alias: 'w',
+ default: false,
+ })
.help().argv;
const contracts = _.isUndefined(argv.contracts)
? undefined
@@ -37,7 +41,11 @@ const SEPARATOR = ',';
contracts,
};
const compiler = new Compiler(opts);
- await compiler.compileAsync();
+ if (argv.watch) {
+ await compiler.watchAsync();
+ } else {
+ await compiler.compileAsync();
+ }
})().catch(err => {
logUtils.log(err);
process.exit(1);