Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/cli.js
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2010-11-20 05:20:29 +0300
committerisaacs <i@izs.me>2010-11-20 05:20:29 +0300
commit1a955dc321fa5d235a8ba1345dc2e9149ec7be0e (patch)
tree2135c55963e0feb141f741492330b74b19c5ff0e /cli.js
parent1827f90e0fdd67810d5bbc6924131d3765a3fbc6 (diff)
Updates to make it work with writev
When writing to stdout, and then calling process.exit right after, the write never happens. Probably a bug in node.
Diffstat (limited to 'cli.js')
-rwxr-xr-xcli.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/cli.js b/cli.js
index 7c53ea344..1d74e9bdb 100755
--- a/cli.js
+++ b/cli.js
@@ -1,5 +1,5 @@
#!/usr/bin/env node
-
+;(function () { // wrapper in case we're in module_context mode
// don't assume that npm is installed in any particular spot, since this
// might conceivably be a bootstrap attempt.
var log = require("./lib/utils/log")
@@ -51,8 +51,8 @@ npm.argv = arglist
var vindex = arglist.indexOf("-v")
, printVersion = vindex !== -1 || conf.version
if (printVersion) {
- sys.puts(npm.version)
- process.exit(0)
+ console.log(npm.version)
+ return
} else log("npm@"+npm.version, "using")
log("node@"+process.version, "using")
@@ -81,3 +81,4 @@ npm.load(conf, function (er) {
if (er) return errorHandler(er)
npm.commands[command](arglist, errorHandler)
})
+})()