fix: config parse error at launch

This commit is contained in:
yicheng 2020-04-20 10:53:48 +08:00
parent bdbb345010
commit f6341c1721
2 changed files with 5 additions and 1 deletions

View File

@ -94,6 +94,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
removeUnExistProxyGroups()
// start proxy
initClashCore()
setupData()
updateConfig(showNotification: false)
updateLoggingLevel()

View File

@ -46,10 +46,13 @@ func checkPortAvailable(port int, lan bool) bool {
return true
}
func parseConfig(checkPort bool) (*config.Config, error) {
//export initClashCore
func initClashCore() {
configFile := filepath.Join(constant.Path.HomeDir(), constant.Path.Config())
constant.SetConfig(configFile)
}
func parseConfig(checkPort bool) (*config.Config, error) {
cfg, err := executor.Parse()
if err != nil {
return nil, err