From 30215b163a7fcc8311b15c17fc29beb7eefa7061 Mon Sep 17 00:00:00 2001 From: HannesOberreiter Date: Thu, 25 May 2023 20:08:34 +0200 Subject: [PATCH] fix: :bug: create data folder if not exists --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index 315c731..c0d173c 100644 --- a/index.js +++ b/index.js @@ -4,6 +4,10 @@ const analysis = require("./analysis"); let items = []; let itemsJson = ""; (async () => { + if (!fs.existsSync("data")) { + fs.mkdirSync("data"); + } + if (fs.existsSync("data/latest-canonical.json")) { items = JSON.parse(fs.readFileSync("data/latest-canonical.json")); itemsJson = JSON.stringify(items)