grunt-parallel
Advanced tools
Comparing version 0.0.3 to 0.1.0
@@ -25,19 +25,25 @@ module.exports = function(grunt) { | ||
parallel: { | ||
assets: [{ | ||
mix: { | ||
tasks: [{ | ||
grunt: true, | ||
args: ['fast'] | ||
}, { | ||
grunt: true, | ||
args: ['block'] | ||
}, { | ||
cmd: 'pwd' | ||
},{ | ||
grunt: true, | ||
args: ['fast'] | ||
}] | ||
}, | ||
shell: { | ||
tasks: [{ | ||
cmd: 'whoami' | ||
}] | ||
}, | ||
grunt: { | ||
grunt: true, | ||
args: ['fast'] | ||
}, { | ||
grunt: true, | ||
args: ['block'] | ||
},{ | ||
grunt: true, | ||
args: ['fast'] | ||
}], | ||
fail: [{ | ||
grunt: true, | ||
args: ['fast'] | ||
}, { | ||
grunt: true, | ||
args: ['fail'] | ||
}] | ||
tasks: ['fast', 'block', 'fast'] | ||
} | ||
} | ||
@@ -44,0 +50,0 @@ }); |
{ | ||
"name": "grunt-parallel", | ||
"description": "Run tasks or commands in child processes.", | ||
"version": "0.0.3", | ||
"version": "0.1.0", | ||
"homepage": "https://github.com/iammerrick/grunt-parallel", | ||
@@ -36,4 +36,6 @@ "author": { | ||
"dependencies": { | ||
"q": "~0.8.12" | ||
"q": "~0.8.12", | ||
"grunt": "~0.4.1", | ||
"lpad": "~0.1.0" | ||
} | ||
} |
@@ -21,3 +21,3 @@ # grunt-parallel | ||
* <tt>commands</tt> - An array of commands to run, each deferred to: http://gruntjs.com/api/grunt.util#grunt.util.spawn | ||
* <tt>tasks</tt> - An array of commands to run, each deferred to: http://gruntjs.com/api/grunt.util#grunt.util.spawn | ||
@@ -27,11 +27,28 @@ ```javascript | ||
parallel: { | ||
assets: [{ | ||
assets: { | ||
tasks: [{ | ||
grunt: true, | ||
args: ['requirejs'] | ||
}, { | ||
grunt: true, | ||
args: ['compass'] | ||
},{ | ||
cmd: 'some-custom-shell-script.sh' | ||
}] | ||
} | ||
} | ||
}); | ||
``` | ||
#### Only Using Grunt | ||
If you are only going to delegate to other grunt tasks you can simply put `grunt: true` in your tasks configuration and grunt-parallel will run them all using grunt. | ||
```javascript | ||
grunt.initConfig({ | ||
parallel: { | ||
assets: { | ||
grunt: true, | ||
args: ['requirejs'] | ||
}, { | ||
grunt: true, | ||
args: ['compass'] | ||
},{ | ||
cmd: 'some-custom-shell-script.sh' | ||
}] | ||
tasks: ['fast', 'block', 'fast'] | ||
} | ||
} | ||
@@ -38,0 +55,0 @@ }); |
@@ -11,2 +11,3 @@ /* | ||
var Q = require('q'); | ||
var lpad = require('lpad'); | ||
@@ -19,13 +20,9 @@ function spawn(task) { | ||
var message = result.stderr || result.stdout; | ||
grunt.log.error(message); | ||
if (error.message) { | ||
grunt.log.error(error.message); | ||
} | ||
return deferred.reject(); | ||
} | ||
grunt.log.writeln(result.toString('ascii')); | ||
grunt.log.writeln('\n' + result); | ||
@@ -39,6 +36,19 @@ deferred.resolve(); | ||
grunt.registerMultiTask('parallel', 'Run sub-tasks in parallel.', function() { | ||
lpad.stdout(' '); | ||
var done = this.async(); | ||
Q.all(this.data.map(spawn)).then(done, done.bind(this, false)); | ||
// If the configuration specifies that the task is a grunt task. Make it so. | ||
if (this.data.grunt === true) { | ||
this.data.tasks = this.data.tasks.map(function(task) { | ||
return { | ||
args: task, | ||
grunt: true | ||
} | ||
}); | ||
} | ||
Q.all(this.data.tasks.map(spawn)).then(done, done.bind(this, false)).finally(function() { | ||
lpad.stdout(); | ||
}); | ||
}); | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5774
90
61
3
+ Addedgrunt@~0.4.1
+ Addedlpad@~0.1.0
+ Addedabbrev@1.1.1(transitive)
+ Addedargparse@0.1.16(transitive)
+ Addedasync@0.1.22(transitive)
+ Addedcoffee-script@1.3.3(transitive)
+ Addedcolors@0.6.2(transitive)
+ Addeddateformat@1.0.2-1.2.3(transitive)
+ Addedesprima@1.0.4(transitive)
+ Addedeventemitter2@0.4.14(transitive)
+ Addedexit@0.1.2(transitive)
+ Addedfindup-sync@0.1.3(transitive)
+ Addedgetobject@0.1.0(transitive)
+ Addedglob@3.1.213.2.11(transitive)
+ Addedgraceful-fs@1.2.3(transitive)
+ Addedgrunt@0.4.5(transitive)
+ Addedgrunt-legacy-log@0.1.3(transitive)
+ Addedgrunt-legacy-log-utils@0.1.1(transitive)
+ Addedgrunt-legacy-util@0.2.0(transitive)
+ Addedhooker@0.2.3(transitive)
+ Addediconv-lite@0.2.11(transitive)
+ Addedinherits@1.0.22.0.4(transitive)
+ Addedjs-yaml@2.0.5(transitive)
+ Addedlodash@0.9.22.4.2(transitive)
+ Addedlpad@0.1.0(transitive)
+ Addedlru-cache@2.7.3(transitive)
+ Addedminimatch@0.2.140.3.0(transitive)
+ Addednopt@1.0.10(transitive)
+ Addedrimraf@2.2.8(transitive)
+ Addedsigmund@1.0.1(transitive)
+ Addedunderscore@1.7.0(transitive)
+ Addedunderscore.string@2.2.12.3.32.4.0(transitive)
+ Addedwhich@1.0.9(transitive)