diff --git a/doric-cli/src/actions.ts b/doric-cli/src/actions.ts index bc122389..0c297f7b 100644 --- a/doric-cli/src/actions.ts +++ b/doric-cli/src/actions.ts @@ -12,7 +12,7 @@ export async function build() { }); if (ret !== 0) { console.log("Compile error".red); - return; + return -1; } ret = await Shell.exec("node", ["node_modules/.bin/rollup", "-c",], { env: process.env, @@ -22,7 +22,7 @@ export async function build() { }); if (ret !== 0) { console.log("Compile error".red); - return; + return -1; } const bundleFiles = await glob("bundle/**/*.js"); for (let bundleFile of bundleFiles) { @@ -41,6 +41,7 @@ export async function build() { } } } + return 0 } export async function clean() { diff --git a/doric-cli/src/index.ts b/doric-cli/src/index.ts index 20a18c0c..4e9e4c71 100644 --- a/doric-cli/src/index.ts +++ b/doric-cli/src/index.ts @@ -26,7 +26,10 @@ commander commander .command('build') .action(async function () { - await build(); + const ret = await build(); + if (ret != 0) { + process.exit(ret) + } }) commander .command('clean')