diff options
author | isaacs <i@izs.me> | 2011-06-11 05:10:14 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2011-06-11 05:10:14 +0400 |
commit | 03bd66932c83f4233c9e3fb33bd36a1edf930db9 (patch) | |
tree | 4aad9b912d02ea2a2e60a416affa48eeec7b32ad /bin | |
parent | 7124cf3346d7c5cfc8a04aa98e15a3c5068dd56d (diff) |
Support 'npm-g' as a global bin
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/npm.js | 6 |
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) |