refactor: simplify isExecutable (#2450)

This commit is contained in:
CatsDeservePets authored and GitHub committed 2026-03-22 01:09:49 +01:00
1 parent d9bfc11761
commit f63d1b599c
1 file changed
+2 -7
+2 -7
View File
@@ -7,6 +7,7 @@ import (
"os/exec"
"os/user"
"path/filepath"
"slices"
"strings"
"syscall"
@@ -185,13 +186,7 @@ func isExecutable(f os.FileInfo) bool {
if ext == "" {
return false
}
ext = strings.ToLower(ext)
for _, x := range envPathExts {
if ext == x {
return true
}
}
return false
return slices.Contains(envPathExts, strings.ToLower(ext))
}
func isHidden(f os.FileInfo, path string, hiddenfiles []string) bool {