提交 5ba8940d 编写于 作者: J Joao Moreno

catch unhandled promise rejections in build

上级 2cdc2b3d
......@@ -229,6 +229,11 @@ gulp.task('hygiene', () => hygiene());
if (require.main === module) {
const cp = require('child_process');
process.on('unhandledRejection', (reason, p) => {
console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
process.exit(1);
});
cp.exec('git config core.autocrlf', (err, out) => {
const skipEOL = out.trim() === 'true';
......
......@@ -58,8 +58,14 @@ var ALL_EDITOR_TASKS = [
'tslint',
'hygiene',
];
var runningEditorTasks = process.argv.length > 2 && process.argv.slice(2).every(function (arg) { return (ALL_EDITOR_TASKS.indexOf(arg) !== -1); });
process.on('unhandledRejection', (reason, p) => {
console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
process.exit(1);
});
if (runningEditorTasks) {
require(`./build/gulpfile.editor`);
require(`./build/gulpfile.hygiene`);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册