MCPcopy
hub / github.com/xpf0000/FlyEnv / init

Function init

src/render/components/Mysql/mysql.ts:21–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19 getters: {},
20 actions: {
21 async init() {
22 if (this.inited) {
23 return
24 }
25 this.inited = true
26 const file = join(window.Server.MysqlDir!, 'group/group.json')
27 fs.existsSync(file).then(async (e) => {
28 if (e) {
29 const arr: Array<any> = []
30 try {
31 const json = await fs.readFile(file)
32 const jsonArr: any = JSON.parse(json)
33 jsonArr.forEach((j: any) => {
34 delete j?.version?.fetching
35 delete j?.version?.running
36 })
37 arr.push(...jsonArr)
38 } catch {
39 /* empty */
40 }
41 this.all.push(...arr)
42 }
43 })
44 },
45 async save() {
46 const json = JSON.parse(JSON.stringify(this.all))
47 json.forEach((j: any) => {

Callers

nothing calls this directly

Calls 3

pushMethod · 0.80
thenMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected