From 3b39d8d85f3b0d5388a2bb325cc8e57a82d7be18 Mon Sep 17 00:00:00 2001 From: Lewis Dale Date: Fri, 18 Oct 2024 19:44:37 +0100 Subject: [PATCH] Handle missing .cache directory --- src/_data/links.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/_data/links.js b/src/_data/links.js index ab62c42..d83b777 100644 --- a/src/_data/links.js +++ b/src/_data/links.js @@ -52,6 +52,9 @@ const cachedContent = () => { } const storeCache = (content = []) => { + if (!fs.existsSync('.cache')) { + fs.mkdirSync('.cache'); + } fs.writeFileSync(cacheFile, JSON.stringify(content)); }