diff options
author | isaacs <i@izs.me> | 2013-05-14 14:37:59 -0700 |
---|---|---|
committer | isaacs <i@izs.me> | 2013-05-14 14:37:59 -0700 |
commit | f7b10f5445248981a39f0f82e10fca7234fca08a (patch) | |
tree | 839a30d65dcdc93e3e7ddaebe2666eb1c27fb306 /deps/npm/lib/explore.js | |
parent | ca38def146c2255503103159677df40c169ccefa (diff) | |
download | node-new-f7b10f5445248981a39f0f82e10fca7234fca08a.tar.gz |
npm: Upgrade to 1.2.21
Diffstat (limited to 'deps/npm/lib/explore.js')
-rw-r--r-- | deps/npm/lib/explore.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/deps/npm/lib/explore.js b/deps/npm/lib/explore.js index 8392c91728..8b55115e0e 100644 --- a/deps/npm/lib/explore.js +++ b/deps/npm/lib/explore.js @@ -1,4 +1,4 @@ -// npm expore <pkg>[@<version>] +// npm explore <pkg>[@<version>] // open a subshell to the package folder. module.exports = explore @@ -6,7 +6,7 @@ explore.usage = "npm explore <pkg> [ -- <cmd>]" explore.completion = require("./utils/completion/installed-shallow.js") var npm = require("./npm.js") - , exec = require("./utils/exec.js") + , spawn = require("child_process").spawn , path = require("path") , fs = require("graceful-fs") @@ -17,15 +17,17 @@ function explore (args, cb) { if (args) args = ["-c", args] else args = [] - var editor = npm.config.get("editor") - , cwd = path.resolve(npm.dir, p) + var cwd = path.resolve(npm.dir, p) + var sh = npm.config.get("shell") fs.stat(cwd, function (er, s) { if (er || !s.isDirectory()) return cb(new Error( "It doesn't look like "+p+" is installed.")) if (!args.length) console.log( "\nExploring "+cwd+"\n"+ "Type 'exit' or ^D when finished\n") - exec(npm.config.get("shell"), args, null, true, cwd, function (er) { + + var shell = spawn(sh, args, { cwd: cwd, customFds: [0, 1, 2] }) + shell.on("close", function (er) { // only fail if non-interactive. if (!args.length) return cb() cb(er) |