Skip to content

Commit

Permalink
Fix npm#2590 Keep lockFile names short
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Jul 5, 2012
1 parent 8d12a0f commit a8d986e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/cache.js
Expand Up @@ -949,8 +949,11 @@ function deprCheck (data) {
}

function lockFileName (u) {
var c = u.replace(/[^a-zA-Z0-9]+/g, '-')
var c = u.replace(/[^a-zA-Z0-9]+/g, "-").replace(/^-+|-+$/g, "")
, h = crypto.createHash("sha1").update(u).digest("hex")
h = h.substr(0, 8)
c = c.substr(-32)
log.silly("lockFile", h + "-" + c, u)
return path.resolve(npm.config.get("cache"), h + "-" + c + ".lock")
}

Expand Down

0 comments on commit a8d986e

Please sign in to comment.