Created
November 25, 2013 15:20
-
-
Save ksummerlin/7642876 to your computer and use it in GitHub Desktop.
Runs all grunt files in sub-folders.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run sub-grunt files | |
grunt.registerMultiTask('subgrunt', 'Run a sub-gruntfile.', function () { | |
var path = require('path'); | |
grunt.util.async.forEachSeries(this.filesSrc, function (gruntfile, next) { | |
grunt.util.spawn({ | |
grunt: true, | |
args: ['--gruntfile', path.resolve(gruntfile)].concat(grunt.option.flags()), | |
}, function (error, result) { | |
if (error) { | |
grunt.log.error(result.stdout).writeln(); | |
next(new Error('Error running sub-gruntfile "' + gruntfile + '".')); | |
} else { | |
grunt.verbose.ok(result.stdout); | |
next(); | |
} | |
}); | |
}, this.async()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment