Skip to content

Commit 50b7c53

Browse files
committed
Create cache folder if not exists.
Signed-off-by: Eric Wang <[email protected]>
1 parent c224eaf commit 50b7c53

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/cache.js

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ cache.get = function(k) {
1313
};
1414

1515
cache.set = function(k, v) {
16+
var dir = h.getCacheDir();
17+
if (!fs.existsSync(dir)) fs.mkdirSync(dir);
18+
1619
var fullpath = h.getCacheFile(k);
1720
fs.writeFileSync(fullpath, JSON.stringify(v));
1821
return true;

0 commit comments

Comments
 (0)