Update fetch-prompts.mjs

remove cn
This commit is contained in:
DirkSchlossmacher 2023-06-06 07:49:54 +02:00 committed by GitHub
parent e1827d51ad
commit 4014eb7bea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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