mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-08 09:23:57 +08:00
feat: using fetch to get buildin masks
This commit is contained in:
23
app/masks/build.ts
Normal file
23
app/masks/build.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import { CN_MASKS } from "./cn";
|
||||
import { TW_MASKS } from "./tw";
|
||||
import { EN_MASKS } from "./en";
|
||||
|
||||
const BUILTIN_MASKS: BuiltinMask[] = {
|
||||
cn: CN_MASKS,
|
||||
tw: TW_MASKS,
|
||||
en: EN_MASKS,
|
||||
};
|
||||
|
||||
const dirname = path.dirname(__filename);
|
||||
|
||||
fs.writeFile(
|
||||
dirname + "/../../public/masks.json",
|
||||
JSON.stringify(BUILTIN_MASKS, null, 4),
|
||||
function (error) {
|
||||
if (error) {
|
||||
console.error("[Build] failed to build masks", error);
|
||||
}
|
||||
},
|
||||
);
|
Reference in New Issue
Block a user