From 755d70c1700f2ab36ba5632ca482b40f0edad04f Mon Sep 17 00:00:00 2001 From: Sunny Luo Date: Tue, 21 Apr 2020 15:08:11 +0800 Subject: [PATCH 1/2] Fix wrong output file option in cli --- bin/cli.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cli.js b/bin/cli.js index acaa8588..94d14391 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -152,7 +152,7 @@ function run() { let template = fs.readFileSync(templatePath).toString(); let output = ejs.render(template, vals, opts); - if (pOpts.outputFile) { + if (pOpts['output-file']) { fs.writeFileSync(pOpts.outputFile, output); } else { From e527cd2cd9186c82b0a9de5ac5f3005200168a3c Mon Sep 17 00:00:00 2001 From: Sunny Luo Date: Tue, 21 Apr 2020 15:14:32 +0800 Subject: [PATCH 2/2] Update cli.js --- bin/cli.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cli.js b/bin/cli.js index 94d14391..da302e76 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -153,7 +153,7 @@ function run() { let template = fs.readFileSync(templatePath).toString(); let output = ejs.render(template, vals, opts); if (pOpts['output-file']) { - fs.writeFileSync(pOpts.outputFile, output); + fs.writeFileSync(pOpts['output-file'], output); } else { process.stdout.write(output);