build(gulp): run beforeExit hook only once
this prevents inifinite loops when cleanup task registers an additional task, that triggers a new beforeExit event Fixes #1833
This commit is contained in:
parent
af9dcad8e3
commit
718d2ae2ee
|
@ -832,6 +832,11 @@ process.on('SIGINT', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
// register cleanup listener for all non-persistent tasks
|
// register cleanup listener for all non-persistent tasks
|
||||||
|
var beforeExitRan = false;
|
||||||
|
|
||||||
process.on('beforeExit', function() {
|
process.on('beforeExit', function() {
|
||||||
|
if (beforeExitRan) return;
|
||||||
|
|
||||||
|
beforeExitRan = true;
|
||||||
gulp.start('cleanup.builder');
|
gulp.start('cleanup.builder');
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue