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) {
|
if (ret !== 0) {
|
||||||
console.log("Compile error".red);
|
console.log("Compile error".red);
|
||||||
return;
|
return -1;
|
||||||
}
|
}
|
||||||
ret = await Shell.exec("node", ["node_modules/.bin/rollup", "-c",], {
|
ret = await Shell.exec("node", ["node_modules/.bin/rollup", "-c",], {
|
||||||
env: process.env,
|
env: process.env,
|
||||||
@ -22,7 +22,7 @@ export async function build() {
|
|||||||
});
|
});
|
||||||
if (ret !== 0) {
|
if (ret !== 0) {
|
||||||
console.log("Compile error".red);
|
console.log("Compile error".red);
|
||||||
return;
|
return -1;
|
||||||
}
|
}
|
||||||
const bundleFiles = await glob("bundle/**/*.js");
|
const bundleFiles = await glob("bundle/**/*.js");
|
||||||
for (let bundleFile of bundleFiles) {
|
for (let bundleFile of bundleFiles) {
|
||||||
@ -41,6 +41,7 @@ export async function build() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function clean() {
|
export async function clean() {
|
||||||
|
@ -26,7 +26,10 @@ commander
|
|||||||
commander
|
commander
|
||||||
.command('build')
|
.command('build')
|
||||||
.action(async function () {
|
.action(async function () {
|
||||||
await build();
|
const ret = await build();
|
||||||
|
if (ret != 0) {
|
||||||
|
process.exit(ret)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
commander
|
commander
|
||||||
.command('clean')
|
.command('clean')
|
||||||
|
Reference in New Issue
Block a user