Comparing version 0.1.14 to 0.2.0
{ | ||
"name": "grunt-run", | ||
"description": "Invite external commands into your grunt process with three tasks `run`, `wait` and `stop`.", | ||
"version": "0.1.14", | ||
"version": "0.2.0", | ||
"homepage": "https://github.com/spenceralger/grunt-run", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -41,8 +41,5 @@ /* | ||
var name = this.target; | ||
if (getPid(name)) { | ||
grunt.log.warn(name + ' is already running'); | ||
return; | ||
} | ||
var cmd = this.data.cmd || 'node'; | ||
var args = this.data.args || []; | ||
var additionalArgs = []; | ||
var opts = this.options({ | ||
@@ -54,9 +51,6 @@ wait: true, | ||
cwd: process.cwd(), | ||
passArgs: [] | ||
passArgs: [], | ||
itterable: false | ||
}); | ||
var cmd = this.data.cmd || 'node'; | ||
var args = this.data.args || []; | ||
var additionalArgs = []; | ||
var options = { | ||
var spawnOpts = { | ||
cwd: opts.cwd, | ||
@@ -66,2 +60,12 @@ stdio: ['ignore', 'pipe', 'pipe'] | ||
if (getPid(name)) { | ||
grunt.log.warn(name + ' is already running'); | ||
return; | ||
} | ||
if (!opts.itterable && _.find(process.argv, 'run')) { | ||
grunt.log.warn('Skipping run:' + this.target + ' since it not itterable. Call it directly or from another task.'); | ||
return; | ||
} | ||
opts.passArgs.map(function (arg) { | ||
@@ -87,3 +91,3 @@ var val = grunt.option(arg); | ||
args = ['/s', '/c', '"' + this.data.exec + '"']; | ||
options.windowsVerbatimArguments = true; | ||
spawnOpts.windowsVerbatimArguments = true; | ||
} else { | ||
@@ -102,3 +106,3 @@ cmd = '/bin/sh'; | ||
grunt.verbose.writeln('running', cmd, 'with args', args); | ||
var proc = child_process.spawn(cmd, args, options); | ||
var proc = child_process.spawn(cmd, args, spawnOpts); | ||
savePid(name, proc.pid); | ||
@@ -105,0 +109,0 @@ |
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
13408
194