Skip to content

Commit

Permalink
When running yarn clean also clear the cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
hswolff committed Apr 2, 2016
1 parent 1a09af3 commit 70a0619
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ const cache = {
fs.outputFileSync(filename, content);
},

clear() {
data = {};
},

put(cacheKey, cacheValue) {
data[cacheKey] = cacheValue;
},
Expand Down
3 changes: 3 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ export default class Yarn {
log.error(e);
}

// Clear cache.
cache.clear();

log.endActivity(id);

return promise;
Expand Down

0 comments on commit 70a0619

Please sign in to comment.