mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-08-23 10:42:33 +00:00
Fix: provider should fallback to read remote when local file invalid
This commit is contained in:
parent
dcf97ff5b4
commit
a55be58c01
1 changed files with 5 additions and 1 deletions
|
@ -127,9 +127,13 @@ func (pp *ProxySetProvider) Initial() error {
|
|||
}
|
||||
|
||||
proxies, err := pp.parse(buf)
|
||||
if err != nil {
|
||||
// parse local file error, fallback to remote
|
||||
buf, err = pp.vehicle.Read()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if err := ioutil.WriteFile(pp.vehicle.Path(), buf, fileMode); err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in a new issue