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

View File

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