mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 11:42:43 +08:00
Fix: don't read yml if not exist (#253)
This commit is contained in:
parent
528fbd10e4
commit
288afd1308
|
@ -106,7 +106,11 @@ func readRawConfig(path string) ([]byte, error) {
|
|||
}
|
||||
|
||||
path = path[:len(path)-5] + ".yml"
|
||||
return ioutil.ReadFile(path)
|
||||
if _, err = os.Stat(path); err == nil {
|
||||
return ioutil.ReadFile(path)
|
||||
}
|
||||
|
||||
return data, nil
|
||||
}
|
||||
|
||||
func readConfig(path string) (*rawConfig, error) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user