parallelshell
Advanced tools
Comparing version 1.0.4 to 1.1.0
16
index.js
@@ -1,4 +0,3 @@ | ||
#!/usr/bin/env node | ||
'use strict'; | ||
var exec = require('child_process').exec; | ||
var spawn = require('child_process').spawn; | ||
@@ -12,12 +11,17 @@ function potentialExit (childCmd, code) { | ||
} | ||
var sh = 'sh'; | ||
var shFlag = '-c'; | ||
if (process.platform === 'win32') { | ||
sh = 'cmd'; | ||
shFlag = '/c'; | ||
} | ||
process.argv.slice(2).forEach(function (childCmd) { | ||
var child = exec(childCmd, { | ||
cwd: process.cwd(), | ||
var child = spawn(sh,[shFlag,childCmd], { | ||
cwd: process.cwd, | ||
env: process.env, | ||
stdio: ['pipe', process.stdout, process.stderr] | ||
}) | ||
.on('error', potentialExit.bind(null, childCmd)) | ||
.on('exit', potentialExit.bind(null, childCmd)); | ||
child.stderr.pipe(process.stderr); | ||
child.stdout.pipe(process.stdout); | ||
}); |
{ | ||
"name": "parallelshell", | ||
"version": "1.0.4", | ||
"version": "1.1.0", | ||
"description": "Invoke multiple commands, running in parallel", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/keithamus/parallelshell", |
@@ -27,5 +27,8 @@ ## Parallel Shell | ||
```bash | ||
parallelshell 'echo 1' 'echo 2' 'echo 3' | ||
parallelshell "echo 1" "echo 2" "echo 3" | ||
``` | ||
This will execute the commands `echo 1` `echo 2` and `echo 3` simultaneously. | ||
Note that on Windows, you need to use double-quotes to avoid confusing the | ||
argument parser. |
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
2836
4
24
34