This commit is contained in:
DirkSchlossmacher 2024-08-28 12:08:46 +02:00
parent 87e612c147
commit 34fbad9e9b

View File

@ -82,17 +82,17 @@ async function fetchEN() {
}
async function main() {
Promise.all([fetchEN()])
.then(([en]) => {
fs.writeFile(FILE, JSON.stringify({en }));
Promise.all([fetchCN(), fetchTW(), fetchEN()])
.then(([cn, tw, en]) => {
fs.writeFile(FILE, JSON.stringify({ cn, tw, en }));
})
.catch((e) => {
console.error("[Fetch] failed to fetch prompts");
fs.writeFile(FILE, JSON.stringify({en: [] }));
fs.writeFile(FILE, JSON.stringify({ cn: [], tw: [], en: [] }));
})
.finally(() => {
console.log("[Fetch] saved to " + FILE);
});
}
main();
main();