Skip to content

Commit

Permalink
fix(theme): incorrect auto-frontmatter cache check
Browse files Browse the repository at this point in the history
  • Loading branch information
pengzhanbo committed Sep 18, 2024
1 parent 1985a27 commit ecee1cf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion theme/src/node/autoFrontmatter/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ export function initAutoFrontmatter(
}

async function updateCache(app: App): Promise<void> {
await fs.writeFile(app.dir.cache(CACHE_FILE), JSON.stringify(cache), 'utf-8')
if (!isEmptyObject(cache)) {
await fs.mkdir(path.dirname(app.dir.cache(CACHE_FILE)), { recursive: true })
await fs.writeFile(app.dir.cache(CACHE_FILE), JSON.stringify(cache), 'utf-8')
}
}

generate = {
Expand Down

0 comments on commit ecee1cf

Please sign in to comment.