diff options
author | Eli Doran <eli@elidoran.com> | 2019-01-30 02:29:55 +0300 |
---|---|---|
committer | Audrey Eschright <audrey@lifeofaudrey.com> | 2019-02-14 22:19:49 +0300 |
commit | cb8707a3d507ada2d4e60bef5e588ebb2b88c29c (patch) | |
tree | 93ce9dff15d14d2a92a3c3223056072712ef2a49 /bin | |
parent | 1305bb68bed35745b8426a132719934af1efd4d2 (diff) |
Reduce work to test if executable ends with a 'g'. (#138)
PR-URL: https://github.com/npm/cli/pull/138
Credit: @elidoran
Reviewed-By: @aeschright
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/npm-cli.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/bin/npm-cli.js b/bin/npm-cli.js index 6f76b2382..705aa472e 100755 --- a/bin/npm-cli.js +++ b/bin/npm-cli.js @@ -25,7 +25,6 @@ unsupported.checkForUnsupportedNode() - var path = require('path') var npm = require('../lib/npm.js') var npmconf = require('../lib/config/core.js') var errorHandler = require('../lib/utils/error-handler.js') @@ -37,7 +36,7 @@ // if npm is called as "npmg" or "npm_g", then // run in global mode. - if (path.basename(process.argv[1]).slice(-1) === 'g') { + if (process.argv[1][process.argv[1].length - 1] === 'g') { process.argv.splice(1, 1, 'npm', '-g') } |