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-07-20 02:35:49 +0400
committerisaacs <i@izs.me>2010-07-25 05:51:21 +0400
commitce03c09035dc958cbcc069cfb7f86aef38fc5ef0 (patch)
tree020a0b28cbecfda4440bd710b285d9fa8e1392e1 /cli.js
parente0fe8036ed058146de1e199d83c00c75440f2f66 (diff)
If printing the version, show "ok" rather than "not ok"
Diffstat (limited to 'cli.js')
-rwxr-xr-xcli.js24
1 files changed, 13 insertions, 11 deletions
diff --git a/cli.js b/cli.js
index 10cb5d35e..1fe5fd71a 100755
--- a/cli.js
+++ b/cli.js
@@ -55,17 +55,19 @@ process.on("exit", function () { if (!itWorked) log("not ok") })
var itWorked = false
-if (!command) { if (!printVersion) {
- // npm.commands.help([arglist.join(" ")])
- if (arglist.length) log(arglist, "unknown command")
- sys.error( "What do you want me to do?\n\n"
- + "Usage:\n"
- + " npm [flags] <command> [args]\n"
- + "Check 'man npm' or 'man npm-help' for more information\n\n"
- + "This is supposed to happen. "
- )
- process.exit(1)
-}} else npm.commands[command](arglist, errorHandler)
+if (!command) {
+ if (!printVersion) {
+ // npm.commands.help([arglist.join(" ")])
+ if (arglist.length) log(arglist, "unknown command")
+ sys.error( "What do you want me to do?\n\n"
+ + "Usage:\n"
+ + " npm [flags] <command> [args]\n"
+ + "Check 'man npm' or 'man npm-help' for more information\n\n"
+ + "This is supposed to happen. "
+ )
+ process.exit(1)
+ } else itWorked = true
+} else npm.commands[command](arglist, errorHandler)
function errorHandler (er) {
if (!er) {