diff --git a/tools/deploy/index.ts b/tools/deploy/index.ts index 869faa61..f3097687 100644 --- a/tools/deploy/index.ts +++ b/tools/deploy/index.ts @@ -7,6 +7,23 @@ function collect(value : string, previous : string[]) { return previous.concat([value]); } +function runAq(aq : script.ActionQueue, outputDir : undefined | string, verbose : undefined | true) { + const level = verbose ? 'all' : 'errors'; + if (!aq.valid) { + aq.print(level); + process.exit(1); + } + if (outputDir !== undefined) { + aq.run(outputDir, 'copy'); + } else { + if (level === 'errors') { + console.log(`Success, but nothing to do. Please rerun with -v or -o`); + } else { + aq.print('all'); + } + } +} + program .command('copy [files...]') .option('-o, --output