Skip to content

Commit

Permalink
Updates to make it work with writev
Browse files Browse the repository at this point in the history
When writing to stdout, and then calling process.exit right after, the
write never happens.

Probably a bug in node.
  • Loading branch information
isaacs committed Nov 20, 2010
1 parent 1827f90 commit 1a955dc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cli.js
Original file line number Diff line number Diff line change
@@ -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")
Expand Down Expand Up @@ -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")

Expand Down Expand Up @@ -81,3 +81,4 @@ npm.load(conf, function (er) {
if (er) return errorHandler(er)
npm.commands[command](arglist, errorHandler)
})
})()

0 comments on commit 1a955dc

Please sign in to comment.