diff options
author | isaacs <i@izs.me> | 2010-11-20 05:20:29 +0300 |
---|---|---|
committer | isaacs <i@izs.me> | 2010-11-20 05:20:29 +0300 |
commit | 1a955dc321fa5d235a8ba1345dc2e9149ec7be0e (patch) | |
tree | 2135c55963e0feb141f741492330b74b19c5ff0e | |
parent | 1827f90e0fdd67810d5bbc6924131d3765a3fbc6 (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.
-rwxr-xr-x | cli.js | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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) }) +})() |