use 'customFds' instead of 'stdio'

For the good of 0.6
This commit is contained in:
isaacs
2013-04-29 08:42:19 -07:00
parent be097b9b78
commit 80d2e4eb64
3 changed files with 9 additions and 5 deletions

View File

@@ -26,7 +26,7 @@ function explore (args, cb) {
"\nExploring "+cwd+"\n"+
"Type 'exit' or ^D when finished\n")
var shell = spawn(s, args, {cwd: cwd, stdio: "inherit"})
var shell = spawn(s, args, { cwd: cwd, customFds: [0, 1, 2] })
shell.on("close", function (er) {
// only fail if non-interactive.
if (!args.length) return cb()

View File

@@ -60,7 +60,8 @@ function help (args, cb) {
switch (viewer) {
case "woman":
var a = ["-e", "(woman-find-file \"" + sectionPath + "\")"]
var woman = spawn("emacsclient", a, {env: env, stdio: "inherit"})
var conf = { env: env, customFds: [ 0, 1, 2] }
var woman = spawn("emacsclient", a, conf)
woman.on("close", cb)
break
@@ -69,7 +70,8 @@ function help (args, cb) {
break
default:
var man = spawn("man", [num, section], {env: env, stdio: "inherit"})
var conf = { env: env, customFds: [ 0, 1, 2] }
var man = spawn("man", [num, section], conf)
man.on("close", cb)
}
}

View File

@@ -150,7 +150,8 @@ function runPackageLifecycle (pkg, env, wd, unsafe, cb) {
console.log(note)
var proc = spawn(sh, [shFlag, cmd], {cwd: wd, env: env, stdio: "inherit"})
var conf = { cwd: wd, env: env, customFds: [ 0, 1, 2] }
var proc = spawn(sh, [shFlag, cmd], conf)
proc.on("close", function (er, stdout, stderr) {
if (er && !npm.ROLLBACK) {
log.info(pkg._id, "Failed to exec "+stage+" script")
@@ -185,7 +186,8 @@ function runHookLifecycle (pkg, env, wd, unsafe, cb) {
fs.stat(hook, function (er) {
if (er) return cb()
var proc = spawn("sh", ["-c", cmd], {cwd: wd, env: env, stdio: "inherit"})
var conf = { cwd: wd, env: env, customFds: [ 0, 1, 2] }
var proc = spawn("sh", ["-c", cmd], conf)
proc.on("close", function (er) {
if (er) {
er.message += "\nFailed to exec "+stage+" hook script"