Skip to content

Commit c416fae

Browse files
committed
fix: just create the base files directly
1 parent cde5077 commit c416fae

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

public/resources/data/avatars.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

public/resources/data/status.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]

scripts/downloadImages.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ const effects = new Set([
2121
]);
2222

2323
async function updateFile(path, data) {
24-
// Create blank if not exists
25-
await fs.writeFile(path, JSON.stringify(Array.isArray(data) ? [] : {}), { flag: 'wx' });
26-
2724
// Load existing
2825
const file = await fs.readFile(path);
2926
const existing = JSON.parse(file.toString());
@@ -76,7 +73,7 @@ fetch('https://undercards.net/AllCards')
7673
})))
7774
.then((avatars) => Promise.all([
7875
updateFile(resolve(base, 'data', 'avatars.json'), avatars),
79-
updateFile(resolve(base, 'data', 'effects.json'), effects.values()),
76+
updateFile(resolve(base, 'data', 'status.json'), effects.values()),
8077
downloadAvatars(Object.values(avatars)),
8178
downloadEffects(),
8279
]));

0 commit comments

Comments
 (0)