Skip to content

Commit

Permalink
Merge pull request #3 from xuexb/master
Browse files Browse the repository at this point in the history
add clearAll for cacheDir
  • Loading branch information
royriojas committed Nov 1, 2015
2 parents 7dbd700 + 97383d9 commit c3d3320
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,9 @@ module.exports = {
* @method clearAll
* @returns {Boolean} true if the cache folder was deleted. False otherwise
*/
clearAll: function () {
return del( path.resolve( __dirname, './.cache/' ), {
clearAll: function (cacheDir) {
var filePath = cacheDir ? path.resolve( cacheDir ) : path.resolve( __dirname, './.cache/' );
return del( filePath, {
force: true
} ).length > 0;
}
Expand Down

0 comments on commit c3d3320

Please sign in to comment.