build(gulp): don't try to run cleanup.builder task if builders were not initialized

This commit is contained in:
Igor Minar 2015-06-05 23:43:11 -07:00
parent 7140c9cc34
commit fda8b1d87c
1 changed files with 10 additions and 7 deletions

View File

@ -63,9 +63,7 @@ var angularBuilder = {
rebuildBrowserProdTree: throwToolsBuildMissingError,
rebuildNodeTree: throwToolsBuildMissingError,
rebuildDartTree: throwToolsBuildMissingError,
cleanup: function() {
return Promise.resolve();
}
mock: true
};
@ -886,9 +884,11 @@ gulp.task('cleanup.builder', function(done) {
// register cleanup listener for ctrl+c/kill used to quit any persistent task (autotest or serve tasks)
process.on('SIGINT', function() {
runSequence('cleanup.builder', function() {
process.exit();
});
if (!angularBuilder.mock) {
runSequence('cleanup.builder', function () {
process.exit();
});
}
});
@ -899,5 +899,8 @@ process.on('beforeExit', function() {
if (beforeExitRan) return;
beforeExitRan = true;
gulp.start('cleanup.builder');
if (!angularBuilder.mock) {
gulp.start('cleanup.builder');
}
});