mirror of
https://github.com/badlogic/heissepreise.git
synced 2024-06-30 12:27:15 +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 items = [];
|
||||||
let itemsJson = "";
|
let itemsJson = "";
|
||||||
(async () => {
|
(async () => {
|
||||||
|
if (!fs.existsSync("data")) {
|
||||||
|
fs.mkdirSync("data");
|
||||||
|
}
|
||||||
|
|
||||||
if (fs.existsSync("data/latest-canonical.json")) {
|
if (fs.existsSync("data/latest-canonical.json")) {
|
||||||
items = JSON.parse(fs.readFileSync("data/latest-canonical.json"));
|
items = JSON.parse(fs.readFileSync("data/latest-canonical.json"));
|
||||||
itemsJson = JSON.stringify(items)
|
itemsJson = JSON.stringify(items)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user