diff options
Diffstat (limited to 'deps/npm/lib/cache.js')
-rw-r--r-- | deps/npm/lib/cache.js | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/deps/npm/lib/cache.js b/deps/npm/lib/cache.js index 3739968f6dc..a8bd6b388f7 100644 --- a/deps/npm/lib/cache.js +++ b/deps/npm/lib/cache.js @@ -1203,17 +1203,11 @@ function lockFileName (u) { return path.resolve(npm.config.get("cache"), h + "-" + c + ".lock") } -var madeCache = false var myLocks = {} function lock (u, cb) { // the cache dir needs to exist already for this. - if (madeCache) then() - else mkdir(npm.config.get("cache"), function (er) { + getCacheStat(function (er, cs) { if (er) return cb(er) - madeCache = true - then() - }) - function then () { var opts = { stale: npm.config.get("cache-lock-stale") , retries: npm.config.get("cache-lock-retries") , wait: npm.config.get("cache-lock-wait") } @@ -1223,7 +1217,7 @@ function lock (u, cb) { if (!er) myLocks[lf] = true cb(er) }) - } + }) } function unlock (u, cb) { |