diff --git a/gulpfile.js b/gulpfile.js index a7fccd0ee1..e1eae6eb0c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -832,6 +832,11 @@ process.on('SIGINT', function() { }); // register cleanup listener for all non-persistent tasks +var beforeExitRan = false; + process.on('beforeExit', function() { + if (beforeExitRan) return; + + beforeExitRan = true; gulp.start('cleanup.builder'); });