skip non-existing dirs in shell completion
This commit is contained in:
parent
c05a33a751
commit
0c07daf2ef
4
comp.go
4
comp.go
@ -62,6 +62,10 @@ func matchExec(s string) string {
|
|||||||
paths := strings.Split(envPath, ":")
|
paths := strings.Split(envPath, ":")
|
||||||
|
|
||||||
for _, p := range paths {
|
for _, p := range paths {
|
||||||
|
if _, err := os.Stat(p); os.IsNotExist(err) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
fi, err := ioutil.ReadDir(p)
|
fi, err := ioutil.ReadDir(p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Print(err)
|
log.Print(err)
|
||||||
|
Loading…
Reference in New Issue
Block a user