Skip to content

Commit

Permalink
fix creating cache for scoped packages
Browse files Browse the repository at this point in the history
  • Loading branch information
TMisiukiewicz committed Sep 27, 2023
1 parent 5832b01 commit 375e14e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/cli-tools/src/cacheManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ function loadCache(name: string): Cache | undefined {
}

function saveCache(name: string, cache: Cache) {
fs.writeFileSync(
path.resolve(getCacheRootPath(), name),
JSON.stringify(cache, null, 2),
);
const fullPath = path.resolve(getCacheRootPath(), name);

const dir = path.dirname(fullPath);
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir);
}
fs.writeFileSync(fullPath, JSON.stringify(cache, null, 2));
}

/**
Expand Down

0 comments on commit 375e14e

Please sign in to comment.