mirror of
https://github.com/Finesssee/ProxyPilot.git
synced 2026-11-19 02:17:46 +00:00
30 lines
528 B
Go
30 lines
528 B
Go
package desktopctl
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
)
|
|
|
|
func defaultStatePath() string {
|
|
base := os.Getenv("LOCALAPPDATA")
|
|
if base == "" {
|
|
if d, err := os.UserConfigDir(); err == nil && d != "" {
|
|
base = d
|
|
}
|
|
}
|
|
if base == "" {
|
|
base = "."
|
|
}
|
|
|
|
newPath := filepath.Join(base, "ProxyPilot", "ui-state.json")
|
|
oldPath := filepath.Join(base, "CLIProxyAPI", "ui-state.json")
|
|
|
|
if _, err := os.Stat(newPath); err == nil {
|
|
return newPath
|
|
}
|
|
if _, err := os.Stat(oldPath); err == nil {
|
|
return oldPath
|
|
}
|
|
return newPath
|
|
}
|