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/bin
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2011-06-11 05:10:14 +0400
committerisaacs <i@izs.me>2011-06-11 05:10:14 +0400
commit03bd66932c83f4233c9e3fb33bd36a1edf930db9 (patch)
tree4aad9b912d02ea2a2e60a416affa48eeec7b32ad /bin
parent7124cf3346d7c5cfc8a04aa98e15a3c5068dd56d (diff)
Support 'npm-g' as a global bin
Diffstat (limited to 'bin')
-rwxr-xr-xbin/npm.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/npm.js b/bin/npm.js
index b50875734..32d74b34e 100755
--- a/bin/npm.js
+++ b/bin/npm.js
@@ -17,6 +17,12 @@ var fs = require("../lib/utils/graceful-fs")
, types = configDefs.types
, nopt = require("nopt")
+// if npm is called as "npmg" or "npm_g", then
+// run in global mode.
+if(path.basename(process.argv[1]).slice(-1) === "g") {
+ process.argv.splice(1, 1, "npm", "-g")
+}
+
log.verbose(process.argv, "cli")
var conf = nopt(types, shorthands)