depot/pkgs/by-name/gu/gui-for-singbox/bridge.patch
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

34 lines
827 B
Diff

--- old/bridge/bridge.go 2024-11-03 02:07:33.553972040 +0800
+++ new/bridge/bridge.go 2024-11-03 02:10:09.239584378 +0800
@@ -38,11 +38,6 @@
func InitBridge(fs embed.FS) {
// step1: Set Env
- exePath, err := os.Executable()
- if err != nil {
- panic(err)
- }
-
for _, v := range os.Args {
if v == "tasksch" {
Env.FromTaskSch = true
@@ -50,8 +45,8 @@
}
}
- Env.BasePath = filepath.Dir(exePath)
- Env.AppName = filepath.Base(exePath)
+ Env.AppName = "GUI.for.SingBox"
+ Env.BasePath = filepath.Join(os.Getenv("HOME"), ".config", Env.AppName)
// step2: Create a persistent data symlink
if Env.OS == "darwin" {
@@ -128,7 +123,7 @@
}
func (a *App) RestartApp() FlagResult {
- exePath := Env.BasePath + "/" + Env.AppName
+ exePath := Env.AppName
cmd := exec.Command(exePath)
HideExecWindow(cmd)