MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / init

Method init

git_PR/git_PR.ts:84–99  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

82 fileName: "config.json",
83 legacyDirs: ["git_manager", "git"],
84 legacyFiles: [
85 { dir: "git_manager", fileName: "config.json" },
86 { dir: "git", fileName: "config.json" },
87 ],
88 });
89 this.db = await JSONFilePreset<Record<string, any>>(
90 configPath,
91 { ...DEFAULT_CONFIG }
92 );
93 this.initialized = true;
94 } catch (error) {
95 console.error("[git] 初始化配置失败:", error);
96 }
97 }
98
99 static async get(key: string): Promise<string> {
100 await this.init();
101 return this.db?.data[key] ?? DEFAULT_CONFIG[key] ?? "";
102 }

Callers 2

getMethod · 0.95
setMethod · 0.95

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected