Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix #2590 Keep lockFile names short

  • Loading branch information...
commit a8d986e72842690350098c6527c074113f4bd8bf 1 parent 8d12a0f
isaacs isaacs authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/cache.js
5 lib/cache.js
View
@@ -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")
}
Please sign in to comment.
Something went wrong with that request. Please try again.