From 0c07daf2efdafda8a40b17740dac4054e406b0ca Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Tue, 16 Aug 2016 23:18:26 +0300 Subject: [PATCH] skip non-existing dirs in shell completion --- comp.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/comp.go b/comp.go index a38a05a..ebd6e66 100644 --- a/comp.go +++ b/comp.go @@ -62,6 +62,10 @@ func matchExec(s string) string { paths := strings.Split(envPath, ":") for _, p := range paths { + if _, err := os.Stat(p); os.IsNotExist(err) { + continue + } + fi, err := ioutil.ReadDir(p) if err != nil { log.Print(err)