Skip to content

Commit

Permalink
Merge pull request OverZealous#39 from pixelshaded/master
Browse files Browse the repository at this point in the history
Update finish callback to handle errors properly.
  • Loading branch information
OverZealous committed Jul 20, 2015
2 parents 5d1d649 + ea72f87 commit ca6e9cc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ function runSequence(gulp) {
callBack = typeof taskSets[taskSets.length-1] === 'function' ? taskSets.pop() : false,
currentTaskSet,

finish = function(err) {
finish = function(e) {
gulp.removeListener('task_stop', onTaskEnd);
gulp.removeListener('task_err', onError);
if(callBack) {
callBack(err);
} else if(err) {
console.log(colors.red('Error running task sequence:'), err);
callBack(e && e.err ? e.err : undefined);
} else if(e && e.err) {
console.log(colors.red('Error running task sequence:'), e.err);
}
},

Expand Down

0 comments on commit ca6e9cc

Please sign in to comment.