Skip to content

Instantly share code, notes, and snippets.

@tbranyen
Created March 6, 2014 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tbranyen/9400087 to your computer and use it in GitHub Desktop.
Save tbranyen/9400087 to your computer and use it in GitHub Desktop.
Grunt: Register Parallel Tasks
var grunt = require("grunt");
grunt.registerParallelTasks = function(name, tasks) {
function runParallelTasks(tasks) {
tasks.forEach(function(name) {
var task = grunt.util.spawn({ args: [name], grunt: true });
task.stdout.pipe(process.stdout);
task.stderr.pipe(process.stderr);
});
}
grunt.registerTask(name, function() {
this.async();
runParallelTasks(tasks);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment