This commit is contained in:
Kovid Goyal 2023-03-05 14:01:33 +05:30
parent a252ff1c7b
commit 716a048e6c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -17,7 +17,8 @@ var DefaultExeSearchPaths = (&Once[[]string]{Run: func() []string {
candidates := [...]string{"/usr/local/bin", "/opt/bin", "/opt/homebrew/bin", "/usr/bin", "/bin", "/usr/sbin", "/sbin"} candidates := [...]string{"/usr/local/bin", "/opt/bin", "/opt/homebrew/bin", "/usr/bin", "/bin", "/usr/sbin", "/sbin"}
ans := make([]string, 0, len(candidates)) ans := make([]string, 0, len(candidates))
for _, x := range candidates { for _, x := range candidates {
if s, err := os.Stat(x); err != nil && s.IsDir() { if s, err := os.Stat(x); err == nil && s.IsDir() {
ans = append(ans, x)
} }
} }
return ans return ans