From bd5773b730c89f2a7d53e0fdec6a11bf551a35ae Mon Sep 17 00:00:00 2001 From: Friedel Ziegelmayer Date: Tue, 6 Sep 2016 15:00:23 +0200 Subject: [PATCH] fix: stop gulp tasks before exiting Fixes #52 --- gulp/index.js | 6 ++++++ package.json | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gulp/index.js b/gulp/index.js index 5afb9c2b7..3923bbd5c 100644 --- a/gulp/index.js +++ b/gulp/index.js @@ -2,6 +2,7 @@ const gulpRequire = require('gulp-require-tasks') const path = require('path') +const onExit = require('signal-exit') module.exports = (gulp) => { gulp = gulp || require('gulp') @@ -22,4 +23,9 @@ module.exports = (gulp) => { process.exit() }) }) + + onExit(function (code) { + gulp.stop() + process.exit(code) + }) } diff --git a/package.json b/package.json index 9ae678023..edc3b0c40 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,7 @@ "rimraf": "^2.5.4", "run-sequence": "^1.2.2", "semver": "^5.3.0", + "signal-exit": "^3.0.0", "stream-http": "^2.3.1", "transform-loader": "^0.2.3", "webpack": "^2.1.0-beta.20", @@ -91,4 +92,4 @@ "Stephen Whitmore ", "greenkeeperio-bot " ] -} \ No newline at end of file +}