build: fix build script to exit with code when error occurs
This commit is contained in:
parent
1d0e31a423
commit
8924e7aadc
5
build.js
5
build.js
@ -1,7 +1,7 @@
|
|||||||
const { spawn } = require('child_process');
|
const { spawn } = require('child_process');
|
||||||
const fs = require('fs/promises');
|
const fs = require('fs/promises');
|
||||||
const pt = require('path');
|
const pt = require('path');
|
||||||
const { argv } = require('process');
|
const { argv, exit } = require('process');
|
||||||
|
|
||||||
const conf = {
|
const conf = {
|
||||||
name: "java-jscript",
|
name: "java-jscript",
|
||||||
@ -74,6 +74,7 @@ async function compileJava() {
|
|||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
if (argv[2] === 'debug') throw e;
|
if (argv[2] === 'debug') throw e;
|
||||||
else console.log(e.toString());
|
console.log(e.toString());
|
||||||
|
exit(-1);
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
Loading…
Reference in New Issue
Block a user