diff --git a/plugins/plugins.go b/plugins/plugins.go index c4ab73dff..1262904aa 100644 --- a/plugins/plugins.go +++ b/plugins/plugins.go @@ -38,7 +38,7 @@ func Available() (List, error) { paths = append(paths, strings.Split(os.Getenv("PATH"), ":")...) } for _, p := range paths { - if strings.HasPrefix(strings.ToLower(p), `c:\windows`) { + if ignorePath(p) { continue } if _, err := os.Stat(p); err != nil { @@ -93,3 +93,13 @@ func askBin(path string) Commands { } return commands } + +func ignorePath(p string) bool { + p = strings.ToLower(p) + for _, x := range []string{`c:\windows`, `c:\program`} { + if strings.HasPrefix(p, x) { + return true + } + } + return false +}