Skip to content

Commit 95f7587

Browse files
fix: Creating cache for scoped packages (#2089)
* fix creating cache for scoped packages * remove directory check
1 parent 5832b01 commit 95f7587

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/cli-tools/src/cacheManager.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ function loadCache(name: string): Cache | undefined {
2626
}
2727

2828
function saveCache(name: string, cache: Cache) {
29-
fs.writeFileSync(
30-
path.resolve(getCacheRootPath(), name),
31-
JSON.stringify(cache, null, 2),
32-
);
29+
const fullPath = path.resolve(getCacheRootPath(), name);
30+
31+
fs.mkdirSync(path.dirname(fullPath), {recursive: true});
32+
fs.writeFileSync(fullPath, JSON.stringify(cache, null, 2));
3333
}
3434

3535
/**

0 commit comments

Comments
 (0)