Permalink
Browse files

Fix #2590 Keep lockFile names short

  • Loading branch information...
1 parent 8d12a0f commit a8d986e72842690350098c6527c074113f4bd8bf @isaacs isaacs committed Jul 5, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 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")
}

0 comments on commit a8d986e

Please sign in to comment.