build: terminate process with non zero error code when build fails

At the moment, error can be undefined sometimes which is causing the process not to be terminated with a non zero error code.
This commit is contained in:
Alan Agius 2019-01-11 08:30:38 +01:00 committed by Keen Yee Liau
parent f7c6719f73
commit 95c72677a5

View File

@ -68,7 +68,7 @@ try {
.then(() => require(scriptPath).default(args, logger, cwd)) .then(() => require(scriptPath).default(args, logger, cwd))
.then(exitCode => process.exit(exitCode || 0)) .then(exitCode => process.exit(exitCode || 0))
.catch(err => { .catch(err => {
logger.fatal(err.stack); logger.fatal(err && err.stack);
process.exit(99); process.exit(99);
}); });
} catch (err) { } catch (err) {