Skip to content

Commit

Permalink
Reduce work to test if executable ends with a 'g'. (#138)
Browse files Browse the repository at this point in the history
PR-URL: #138
Credit: @elidoran
Reviewed-By: @aeschright
  • Loading branch information
elidoran authored and aeschright committed Jan 29, 2019
1 parent 4970d55 commit d9b6090
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions bin/npm-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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')
}

Expand Down

0 comments on commit d9b6090

Please # to comment.