Skip to content

Commit

Permalink
Merge pull request #155 from pcdevil/fix/run_multiple_tasks
Browse files Browse the repository at this point in the history
Fix grunt task run fail handling
  • Loading branch information
dorgan committed Jun 6, 2016
2 parents 0815aeb + 6e1180a commit 0dd2144
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions tasks/grunt-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,21 +305,18 @@ module.exports = function(grunt) {

function runTasks(taskName) {
var tasks = options[taskName];
var promises = [];

var fn = function() {
return Q.fcall(function() {
if (tasks.length) {
grunt.log.ok('running ' + taskName + ' ');
if (!nowrite) {
for (var i = 0; i < tasks.length; i++) {
run('grunt ' + tasks[i], '-> ' + tasks[i]);
}
}
if (Array.isArray(tasks) && tasks.length) {
grunt.log.ok('running ' + taskName + ' ');
if (!nowrite) {
for (var i = 0; i < tasks.length; i++) {
promises.push(run('grunt ' + tasks[i], '-> ' + tasks[i]));
}
});
};
}
}

return fn;
return Q.all(promises);
}

new Q()
Expand Down

0 comments on commit 0dd2144

Please sign in to comment.