diff --git a/build/gulpfile.hygiene.js b/build/gulpfile.hygiene.js index 0ca8ea54b9ddb68acd3a3e3e97bdfff2dbe6da68..f53a1c1bd26caa2193d5a5a83b2aa52edd63e3dd 100644 --- a/build/gulpfile.hygiene.js +++ b/build/gulpfile.hygiene.js @@ -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'; diff --git a/gulpfile.js b/gulpfile.js index f82bdbf2bb5fbd5e421b2535a1b0d2cc016de73d..70aab71c296313dc9a18b8cf5c389ee9058283eb 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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`);