fix: toSafeName windows forbidden symbols

This commit is contained in:
2026-05-03 00:08:49 +02:00
parent 9dac9d9795
commit 31441131c4
+5 -2
View File
@@ -5,8 +5,11 @@ import path from "path";
const toSafeName = (name: string) => {
return name
.toLowerCase()
.replace(/[^a-z0-9]/g, "_")
.replace(/-+/g, "_");
.replace(/[<>:"/\\|?*]/g, "_")
.replace(/[\p{Cc}]/gu, "_")
.replace(/[\s-]+/g, "_")
.replace(/_+/g, "_")
.replace(/[. ]+$/g, "");
};
const themeInfo = JSON.parse(fs.readFileSync("theme.json", "utf-8"));