Skip to content
This repository has been archived by the owner on Apr 7, 2021. It is now read-only.

Commit

Permalink
fix(guessCmdName): tests failed because of lazy npa
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Jun 20, 2017
1 parent 16607d9 commit 53a0119
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion parse-args.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ parseArgs.showHelp = () => require('yargs').showHelp()

module.exports._guessCmdName = guessCmdName
function guessCmdName (spec) {
if (typeof spec === 'string') { spec = npa(spec) }
if (typeof spec === 'string') {
if (!npa) { npa = require('npm-package-arg') }
spec = npa(spec)
}
if (spec.scope) {
return spec.name.slice(spec.scope.length + 1)
} else if (spec.registry) {
Expand Down

0 comments on commit 53a0119

Please sign in to comment.