[Bug fix] If the command exits with a code different from 0 then the task has failed #2

wants to merge 1 commit into


None yet

2 participants


No description provided.


Thanks :)

But I don't think this is needed?
It already checks for err which will only output when there are errors.


The check for "err" is clearly not enough.
For example try grunt-shell with "nodeunit test/*.js'" if a test fail the task won't fail but it should.


Works for me. Make sure you have set failOnError to true, it will not fail by default?


No, it doesn't fail with or without failOnError to true.

Try with:

shell: {
      nodeunit: {
        command: 'nodeunit test/**/*.js',
        stdout: true,
        stderr: true,
        warnOnError: true

You won't see the

<WARN> Task "shell:nodeunit" failed. Use --force to continue. </WARN>

but you will with the fix. Falling on exit code != 0 is useful for notifying other grunt plugins that everything went fine or not.


Found the error. When stderr was true, it was taking precedence over failOnError and only logging the error.

Thanks for reporting this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment