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

Commit

Permalink
Merge pull request #13 from Yvem/patch-1
Browse files Browse the repository at this point in the history
bug(prune): handle OSes on whom fs.stats hasn't birthTime
  • Loading branch information
Offirmo committed Feb 18, 2016
2 parents 3b77dc8 + 4718fbc commit 6f4e7b2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/prune-cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ function pruneCache(npmPkgrCache, cb) {
monthAgo.setMonth(monthAgo.getMonth() - 1);

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

Expand Down

0 comments on commit 6f4e7b2

Please sign in to comment.