Skip to content
This repository was archived by the owner on Jan 14, 2020. It is now read-only.

Commit 6f4e7b2

Browse files
committed
Merge pull request #13 from Yvem/patch-1
bug(prune): handle OSes on whom fs.stats hasn't birthTime
2 parents 3b77dc8 + 4718fbc commit 6f4e7b2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/prune-cache.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ function pruneCache(npmPkgrCache, cb) {
2121
monthAgo.setMonth(monthAgo.getMonth() - 1);
2222

2323
var oldCache = results.reduce(function (res, curr, idx) {
24-
return (curr.birthtime.getTime() - monthAgo < 0) ?
24+
var creationTime = curr.birthtime || curr.mtime;
25+
return (creationTime.getTime() - monthAgo < 0) ?
2526
res.concat([ cacheFolders[idx] ]) : res;
2627
}, []);
2728

0 commit comments

Comments
 (0)