Skip to content

Commit f9f917b

Browse files
committed
build(gulp): fix cleanup.builder task
- wait for the cleanup to finish (it's async) before exiting on ctrl+c - wait for the cleanup to finish (it's async) onBeforeExit - remove tmp directory during onBeforeExit to cleanup past leaks Closes angular#1919
1 parent e89bf01 commit f9f917b

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

gulpfile.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -823,17 +823,22 @@ gulp.task('build.dart.material', ['build/packages.dart'], function() {
823823
});
824824

825825

826-
gulp.task('cleanup.builder', function() {
827-
angularBuilder.cleanup();
826+
gulp.task('cleanup.builder', function(done) {
827+
angularBuilder.cleanup().then(function() {
828+
del('tmp', done); // TODO(iminar): remove after 2015-06-01
829+
// this is here just to cleanup old files that we leaked in the past
830+
});
828831
});
829832

830833

831834
// register cleanup listener for ctrl+c/kill used to quit any persistent task (autotest or serve tasks)
832835
process.on('SIGINT', function() {
833-
gulp.start('cleanup.builder');
834-
process.exit();
836+
runSequence('cleanup.builder', function() {
837+
process.exit();
838+
});
835839
});
836840

841+
837842
// register cleanup listener for all non-persistent tasks
838843
var beforeExitRan = false;
839844

0 commit comments

Comments
 (0)