Gulp 4 returns with exit code 0 even if there are unfinished tasks
See original GitHub issueWhat were you expecting to happen? Gulp 4 returns a non-zero exit code if tasks are unfinished
What actually happened? Gulp 4 returned exit code zero
Please post a sample of your gulpfile (preferably reduced to just the bit that’s not working)
const gulp = require('gulp')
gulp.task('aaa', () => {
})
When running the task gulp correctly reports that the task has not completed. But the return code of gulp seems to be 0
. I would prefer it to be 1
.
~/website$ node_modules/.bin/gulp aaa
[10:54:26] Using gulpfile ~/website/gulpfile.js
[10:54:26] Starting 'aaa'...
[10:54:26] The following tasks did not complete: aaa
[10:54:26] Did you forget to signal async completion?
~/website$ echo $?
0
What version of gulp are you using?
~/website$ gulp -v
[10:53:13] CLI version 1.4.0
[10:53:13] Local version 4.0.0-alpha.2
What versions of npm and node are you using?
~/website$ node -v
v8.9.3
~/website$ npm -v
5.5.1
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Gulp returns 0 when tasks fail - Stack Overflow
If gulp task gets a stream, it will listen to 'end' event and 'error' event. They corresponds to return code 0 and 1....
Read more >Async Completion - gulp.js
When a stream, promise, event emitter, child process, or observable is returned from a task, the success or error informs gulp whether to...
Read more >Hugo Will Not Rebuild Site after Syncing Gulp Changes
I'm working on a new site and am using NPM and Gulp to work with my SASS files. I'm using Hugo v0.29, Node...
Read more >CoffeeScript
You might have noticed how even though we don't add return statements to CoffeeScript functions, they nonetheless return their final value.
Read more >rollup.js
If an error occurs at either stage, it will return a Promise rejected ... incrementer.js export let count = 0; export function increment()...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For the record, I tested with the latest version, and got the same result:
I just tried setting process.exitCode and it seemed to work for me. See the PR above.