gui-for-clash: 1.18.0 -> 1.21.1

This commit is contained in:
kyehn
2026-03-26 11:39:55 +00:00
committed by kyehn
parent a9048511b5
commit c634b3c4a2
2 changed files with 7 additions and 25 deletions
+5 -5
View File
@@ -18,13 +18,13 @@
let
pname = "gui-for-clash";
version = "1.18.0";
version = "1.21.1";
src = fetchFromGitHub {
owner = "GUI-for-Cores";
repo = "GUI.for.Clash";
tag = "v${version}";
hash = "sha256-M5M3o7RIXszMW2KGv2UDyR002dNOL3FFj0zM4w4D+U0=";
hash = "sha256-eIJYtXa0JdP7hLvBRnWyh0KkdMWvOd2GRXPaqCvP8yE=";
};
metaCommon = {
@@ -53,8 +53,8 @@ let
sourceRoot
;
pnpm = pnpm_10;
fetcherVersion = 2;
hash = "sha256-AHGPAYw/6FRKO2FY1J84NrLcp+bZOclOF6UFY61npFI=";
fetcherVersion = 3;
hash = "sha256-gr6XIhLKWSOJ4LWiliOvMoA9QbPiohrCPmvObz49/pw=";
};
buildPhase = ''
@@ -84,7 +84,7 @@ buildGoModule {
patches = [ ./xdg-path-and-restart-patch.patch ];
vendorHash = "sha256-xQ6TeVoBe8906+/5X1q4e5QHVo+KHymB+yoxM+Obk18=";
vendorHash = "sha256-EeIxt0BzSaZh1F38btUXN9kAvj12nlqEerVgWVGkiuk=";
nativeBuildInputs = [
autoPatchelfHook
@@ -1,27 +1,9 @@
--- a/bridge/bridge.go
+++ b/bridge/bridge.go
@@ -55,9 +55,14 @@
app := NewApp()
- if Env.OS == "darwin" {
- createMacOSSymlink()
- createMacOSMenus(app)
+ if Env.OS == "linux" || Env.OS == "darwin" {
+ userConfigDir, err := os.UserConfigDir()
+ if err == nil {
+ targetPath := filepath.Join(userConfigDir, Env.AppName)
+ if err := os.MkdirAll(targetPath, 0755); err == nil {
+ Env.BasePath = targetPath
+ }
+ }
}
if Env.OS == "windows" {
@@ -80,7 +85,10 @@
}
@@ -93,7 +93,10 @@
func (a *App) RestartApp() FlagResult {
log.Printf("RestartApp")
- exePath := Env.BasePath + "/" + Env.AppName
+ exePath, err := os.Executable()
+ if err != nil {