feat(config): 支持共享代理配置文件,发布 0.5.2
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
//go:build windows
|
||||
|
||||
package config
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"os"
|
||||
)
|
||||
|
||||
func replaceSharedProxyConfigFile(tempPath, targetPath string) error {
|
||||
if err := os.Rename(tempPath, targetPath); err == nil {
|
||||
return nil
|
||||
}
|
||||
if err := os.Remove(targetPath); err != nil && !errors.Is(err, os.ErrNotExist) {
|
||||
return err
|
||||
}
|
||||
return os.Rename(tempPath, targetPath)
|
||||
}
|
||||
Reference in New Issue
Block a user