mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-28 05:30:29 +08:00
fix first run startup failure
This commit is contained in:
parent
7ab035d9ba
commit
18e4a9ab70
@ -181,6 +181,6 @@ export async function setProfileStr(id: string, content: string): Promise<void>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getProfile(id: string): IMihomoConfig {
|
export function getProfile(id: string | undefined): IMihomoConfig {
|
||||||
return yaml.parse(getProfileStr(id))
|
return yaml.parse(getProfileStr(id || 'default'))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,6 @@ import fs from 'fs'
|
|||||||
|
|
||||||
export function generateProfile(): void {
|
export function generateProfile(): void {
|
||||||
const current = getProfileConfig().current
|
const current = getProfileConfig().current
|
||||||
if (!current) return
|
|
||||||
const currentProfile = getProfile(current)
|
const currentProfile = getProfile(current)
|
||||||
const controledMihomoConfig = getControledMihomoConfig()
|
const controledMihomoConfig = getControledMihomoConfig()
|
||||||
const { tun: profileTun = {} } = currentProfile
|
const { tun: profileTun = {} } = currentProfile
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user