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 #1919
This commit is contained in:
parent
e89bf01c2b
commit
f9f917bfa4
11
gulpfile.js
11
gulpfile.js
|
@ -823,17 +823,22 @@ gulp.task('build.dart.material', ['build/packages.dart'], function() {
|
|||
});
|
||||
|
||||
|
||||
gulp.task('cleanup.builder', function() {
|
||||
angularBuilder.cleanup();
|
||||
gulp.task('cleanup.builder', function(done) {
|
||||
angularBuilder.cleanup().then(function() {
|
||||
del('tmp', done); // TODO(iminar): remove after 2015-06-01
|
||||
// this is here just to cleanup old files that we leaked in the past
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// register cleanup listener for ctrl+c/kill used to quit any persistent task (autotest or serve tasks)
|
||||
process.on('SIGINT', function() {
|
||||
gulp.start('cleanup.builder');
|
||||
runSequence('cleanup.builder', function() {
|
||||
process.exit();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// register cleanup listener for all non-persistent tasks
|
||||
var beforeExitRan = false;
|
||||
|
||||
|
|
Loading…
Reference in New Issue