shama/grunt-hub — pull request #13 by wachunga (2013-02-06 18:28:46+00:00)
Title: Exit codes do not propagate when using hub task

Use case: I'm using grunt-hub to run unit tests across multiple grunt.js files. If some tests fail, however, the process still has exit code 0.

before:
```
>> Running [test] on mymodule/node_modules/mysubmodule/grunt.js
>> ✖ 1 of 264 tests failed:
>>
>> 1) fooBar has correct functionality

Running "simplemocha:all" (simplemocha) task
Task "simplemocha:all" failed. Use --force to continue.
Aborted due to warnings.

Done, without errors.
```

Checking the exit code confirms the exit code is 0, as if there were no errors:

```
> echo $?
0
```

This causes my CI server to not flag the build as broken.

after my patch:
```
>> Running [test] on mymodule/node_modules/mysubmodule/grunt.js
>> ✖ 1 of 264 tests failed:
>>
>> 1) fooBar has correct functionality

Running "simplemocha:all" (simplemocha) task
Task "simplemocha:all" failed. Use --force to continue.
Aborted due to warnings.

Task "hub:test" failed. Use --force to continue.
Aborted due to warnings.

> echo $?
1
```

I based my patch on how [https://github.com/yaymukund/grunt-simple-mocha/blob/master/tasks/simple-mocha.js](grunt-simple-mocha) bubbles the errors.