skip non-existing dirs in shell completion

This commit is contained in:
Gokcehan 2016-08-16 23:18:26 +03:00
parent c05a33a751
commit 0c07daf2ef

View File

@ -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)