From 5661d5e1e9fccfb9e7acaf1dc89c685c9663027c Mon Sep 17 00:00:00 2001 From: Christopher Monsanto Date: Thu, 30 Jul 2020 23:34:37 -0400 Subject: [PATCH] deploy: add -n/--no-act to copy() --- tools/deploy/index.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/deploy/index.ts b/tools/deploy/index.ts index 46e36ed3..f767c098 100644 --- a/tools/deploy/index.ts +++ b/tools/deploy/index.ts @@ -18,7 +18,9 @@ program .option('-e, --eval ', 'Expr') .option('-m, --module ', 'Module') .option('-t, --tag ', 'Tag', collect, []) - .action(async (files : string[], {eval: expr, module: mod, output: outputDir, tag: tags}) => { + // from rename(1) + .option('-n, --no-act', 'No act') + .action(async (files : string[], {eval: expr, module: mod, output: outputDir, tag: tags, act}) => { let code : string; if (expr !== undefined) { code = expr; @@ -36,9 +38,14 @@ program const dst = pathlib.join(outputDir, pathlib.path(src, scr.runOnFile(src))); aq.copy(src, dst); } - - // TODO: output - aq.run('copy'); + + if (act) { + aq.run('copy'); + } else { + for (const {src, dst} of aq.describe()) { + console.log(`${pathlib.format(src)} ==> ${pathlib.format(dst)}`); + } + } }); program