From 716a048e6c335fcbf94fdada697e14c62f84957e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 5 Mar 2023 14:01:33 +0530 Subject: [PATCH] ... --- tools/utils/which.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/utils/which.go b/tools/utils/which.go index 209f83d6d..d49e8d3b5 100644 --- a/tools/utils/which.go +++ b/tools/utils/which.go @@ -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"} ans := make([]string, 0, len(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