Skip to content

Commit

Permalink
fix: fix package spec parsing during cache add process
Browse files Browse the repository at this point in the history
Close #1734

PR-URL: #1738
Credit: @mjeanroy
Close: #1738
Reviewed-by: @isaacs

EDIT(@isaacs): Removed test, pending full test coverage of lib/cache.js
  • Loading branch information
mjeanroy authored and isaacs committed Sep 4, 2020
1 parent 8e3e83b commit d6b134f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const add = async (args, where) => {
' npm cache add <folder>\n'
log.silly('cache add', 'args', args)
const spec = args[0] +
(args[1] === undefined || args[1] === null ? `@${args[1]}` : '')
(args[1] === undefined || args[1] === null ? '' : `@${args[1]}`)

log.verbose('cache add', 'spec', spec)
if (!spec) {
Expand Down

0 comments on commit d6b134f

Please sign in to comment.