Skip to content

Commit

Permalink
Allows queued tasks to inherit the flags of the main task. Refs #147
Browse files Browse the repository at this point in the history
  • Loading branch information
sunyatasattva committed Jun 1, 2016
1 parent 9608e05 commit a690f32
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tasks/grunt-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,14 +305,27 @@ module.exports = function(grunt) {

function runTasks(taskName) {
var tasks = options[taskName];
var flags = grunt.option.flags().join(' ');
var msg;

var fn = function() {
return Q.fcall(function() {
if (tasks.length) {
grunt.log.ok('running ' + taskName + ' ');

if(flags.length) {
grunt.log.ok('-> current flags: ' + flags);
}

if (!nowrite) {
for (var i = 0; i < tasks.length; i++) {
run('grunt ' + tasks[i], '-> ' + tasks[i]);
if(typeof tasks[i] === 'string' || !tasks[i].preserveFlags){
msg = '-> ' + tasks[i] + (flags.length ? ' (ignoring current flags)' : '');
run('grunt ' + tasks[i], msg);
}
else if (tasks[i].preserveFlags){
run('grunt ' + tasks[i].name + ' ' + flags, '-> ' + tasks[i].name + ' ' + flags);
}
}
}
}
Expand Down

0 comments on commit a690f32

Please sign in to comment.