-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Exit code 0 on failed require #479
Comments
That doesn't sound right. node should exit with the proper codes on error |
I'm using gulp-chug. It's probably a problem over there. |
cc @robatron |
That's strange; gulp-chug should be emitting an error event when it encounters an exec error. I'll look into it soon. |
Any progress on this? I was trying to use |
@floatdrop You'll have to |
Actually nevermind, fixed in 3.8.4 |
I will go with |
@floatdrop What version are you on? Can I see your task? Need more info |
Sure: // [13:25:59] CLI version 3.8.5
// [13:25:59] Local version 3.8.5
var gulp = require('gulp');
var jshint = require('gulp-jshint');
gulp.task('jshint', function () {
return gulp.src('./api/**/*.js')
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'));
});
gulp.task('lint', runSequence.bind(runSequence, 'jshint', 'jscs'));
/*
❯ gulp lint; echo $?
[13:27:08] Using gulpfile ~/bar.export/gulpfile.js
[13:27:08] Starting 'lint'...
[13:27:08] Starting 'jshint'...
[13:27:08] Finished 'lint' after 18 ms
/Users/floatdrop/bar.export/api/v1/test/schemas/quotelist.js
line 8 col 5 Missing "use strict" statement.
line 17 col 26 'tags' is already defined.
line 18 col 5 Missing "use strict" statement.
line 29 col 5 Missing "use strict" statement.
✖ 4 problems
0
*/ If I append ❯ gulp lint; echo $?
...
✖ 4 problems
1 |
You failed to mention you're using runSequence to run the tasks. What is the exit code of |
Without ❯ gulp jshint; echo $?
[10:49:44] Using gulpfile ~/bar.export/gulpfile.js
[10:49:44] Starting 'jshint'...
/Users/floatdrop/bar.export/api/v1/controllers/radio.js
line 6 col 41 'next' is defined but never used.
✖ 1 problem
[10:49:45] Finished 'jshint' after 1.15 s
0 With ❯ gulp jshint; echo $?
[10:49:29] Using gulpfile ~/bar.export/gulpfile.js
[10:49:29] Starting 'jshint'...
/Users/floatdrop/bar.export/api/v1/controllers/radio.js
line 6 col 41 'next' is defined but never used.
✖ 1 problem
0 |
I'm noticing that I never see a log saying that the task failed, which is why the exit code is 0. If any task fails throughout the duration of the process the switch gets flipped to be exit code 1. The fail reporter should absolutely be failing the task, I'll look into that more |
I found a bug in orchestrator that wasn't emitting the errors on the orchestrator instance when returning a stream that errors. Thus, never setting the flag to true and not |
#88 specifically references failed tasks for exit(1) behavior, but I've got a gulpfile with a failed
require
that exits 0. Is this intended behavior?The text was updated successfully, but these errors were encountered: