foreground-child
Advanced tools
Comparing version 1.3.4 to 1.3.5-beta.0
19
index.js
@@ -5,2 +5,3 @@ var signalExit = require('signal-exit') | ||
var fs = require('fs') | ||
var which = require('which') | ||
@@ -12,2 +13,14 @@ function needsCrossSpawn (exe) { | ||
try { | ||
exe = which.sync(exe) | ||
} catch (er) { | ||
// failure to find the file? cmd probably needed. | ||
return true | ||
} | ||
if (/\.(com|cmd|bat)$/i.test(exe)) { | ||
// need cmd.exe to run command and batch files | ||
return true | ||
} | ||
var buffer = new Buffer(150) | ||
@@ -17,3 +30,7 @@ try { | ||
fs.readSync(fd, buffer, 0, 150, 0) | ||
} catch (e) {} | ||
} catch (e) { | ||
// If it's not an actual file, probably it needs cmd.exe. | ||
// also, would be unsafe to test arbitrary memory on next line! | ||
return true | ||
} | ||
@@ -20,0 +37,0 @@ return /\#\!(.+)/i.test(buffer.toString().trim()) |
{ | ||
"name": "foreground-child", | ||
"version": "1.3.4", | ||
"version": "1.3.5-beta.0", | ||
"description": "Run a child as if it's the foreground process. Give it stdio. Exit when it exits.", | ||
@@ -11,6 +11,7 @@ "main": "index.js", | ||
"cross-spawn-async": "^2.1.1", | ||
"signal-exit": "^2.0.0" | ||
"signal-exit": "^2.0.0", | ||
"which": "^1.2.1" | ||
}, | ||
"devDependencies": { | ||
"tap": "^4.0.0" | ||
"tap": "^5.1.1" | ||
}, | ||
@@ -17,0 +18,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
9104
216
3
1
+ Addedwhich@^1.2.1