Avoid directory not found error

pull/667/head
zsxeee 3 years ago
parent b7528b9a4e
commit a2cc7d1db9
No known key found for this signature in database
GPG Key ID: 895CFFFD8313B3B8

@ -26,10 +26,12 @@ const copyRecursiveSync = function (src, dest) {
} }
}; };
console.log("Arguments:", process.argv) console.log("Arguments:", process.argv);
const baseLangCode = process.argv[2] || "en"; const baseLangCode = process.argv[2] || "en";
console.log("Base Lang: " + baseLangCode); console.log("Base Lang: " + baseLangCode);
fs.rmdirSync("./languages", { recursive: true }); if (fs.existsSync("./languages")) {
fs.rmdirSync("./languages", { recursive: true });
}
copyRecursiveSync("../../src/languages", "./languages"); copyRecursiveSync("../../src/languages", "./languages");
const en = (await import("./languages/en.js")).default; const en = (await import("./languages/en.js")).default;
@ -39,7 +41,7 @@ console.log("Files:", files);
for (const file of files) { for (const file of files) {
if (!file.endsWith(".js")) { if (!file.endsWith(".js")) {
console.log("Skipping " + file) console.log("Skipping " + file);
continue; continue;
} }

Loading…
Cancel
Save