feat:Add return code for cli build
This commit is contained in:
parent
0290c7a929
commit
ff8e7cb0a5
@ -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() {
|
||||
|
@ -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')
|
||||
|
Reference in New Issue
Block a user