From 0949d321589b799f27c9db23f1ce830b7616b7bf Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Mon, 3 Jun 2019 22:04:20 +0200 Subject: [PATCH] fix regression where cli doesnt build index.js --- src/cli.js | 2 +- test/cli.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cli.js b/src/cli.js index f52cad4d..8f03789a 100755 --- a/src/cli.js +++ b/src/cli.js @@ -185,7 +185,7 @@ async function runCmd (argv, stdout, stderr) { // fallthrough case "build": - const buildFiles = runArgs ? resolve(args._[1]) : args._.slice(1); + const buildFiles = (runArgs || args._.length === 2) ? resolve(args._[1]) : args._.slice(1); let startTime = Date.now(); let ps; diff --git a/test/cli.js b/test/cli.js index 5e94c523..5eade451 100644 --- a/test/cli.js +++ b/test/cli.js @@ -3,6 +3,12 @@ args: ["run", "test/integration/test.ts"], expect: { code: 0 } }, + { + args: ["build", "test/integration/test.ts", "-o", "tmp"], + expect (code, stdout, stderr) { + return stdout.toString().indexOf('tmp/index.js') !== -1; + } + }, { args: ["run", "--v8-cache", "test/integration/test.ts"], expect: { code: 0 }