mirror of
https://github.com/zhigang1992/npm.git
synced 2026-05-28 23:51:28 +08:00
use 'customFds' instead of 'stdio'
For the good of 0.6
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user