Skip to content

Commit

Permalink
use exit code 1 when a task fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Contra committed Jun 27, 2014
1 parent 7e32b2a commit d8d7542
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion bin/gulp.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ var cli = new Liftoff({
extensions: interpret.jsVariants
});

// exit with 0 or 1
var failed = false;
process.once('exit', function(code) {
if (code === 0 && failed) {
process.exit(1);
}
});

// parse those args m8
var cliPackage = require('../package');
var versionFlag = argv.v || argv.version;
Expand Down Expand Up @@ -159,7 +167,9 @@ function formatError(e) {
function logEvents(gulpInst) {

// total hack due to fucked up error management in orchestrator
gulpInst.on('err', function () {});
gulpInst.on('err', function () {
failed = true;
});

gulpInst.on('task_start', function (e) {
// TODO: batch these
Expand Down

1 comment on commit d8d7542

@phated
Copy link
Member

@phated phated commented on d8d7542 Jun 27, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woot!

happy dance

Please # to comment.