Skip to content

Commit ba06f83

Browse files
committed
refactor: FindExecutable on Linux will always try to find file under ~/.local/bin
Signed-off-by: leo <longshuang@msn.cn>
1 parent a14ef05 commit ba06f83

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/Native/Linux.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,7 @@ public string FindTerminal(Models.ShellOrTerminal shell)
6060
finder.Zed(() =>
6161
{
6262
var exec = FindExecutable("zeditor");
63-
if (string.IsNullOrEmpty(exec))
64-
{
65-
exec = FindExecutable("zed");
66-
if (string.IsNullOrEmpty(exec))
67-
exec = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".local", "bin", "zed");
68-
}
69-
70-
return exec;
63+
return string.IsNullOrEmpty(exec) ? FindExecutable("zed") : exec;
7164
});
7265
return finder.Tools;
7366
}
@@ -141,7 +134,8 @@ private string FindExecutable(string filename)
141134
return test;
142135
}
143136

144-
return string.Empty;
137+
var local = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".local", "bin", filename);
138+
return File.Exists(local) ? local : string.Empty;
145139
}
146140

147141
private string FindJetBrainsFleet(string localAppDataDir)

0 commit comments

Comments
 (0)