mirror of
https://github.com/badlogic/heissepreise.git
synced 2024-06-23 00:45:41 +02:00
fix: 🐛 create data folder if not exists
This commit is contained in:
parent
f07c08136e
commit
30215b163a
4
index.js
4
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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user