mirror of https://github.com/maxcnunes/gaper.git
Apply logic to ignore invalid extensions for non glob matches
This commit is contained in:
parent
56a75324ca
commit
69ab70821a
11
watcher.go
11
watcher.go
|
@ -189,11 +189,12 @@ func resolvePaths(paths []string, extensions map[string]bool) (map[string]bool,
|
|||
}
|
||||
|
||||
for _, match := range matches {
|
||||
// don't care for extension filter right now for non glob paths
|
||||
// since they could be a directory
|
||||
if isGlob {
|
||||
if _, ok := extensions[filepath.Ext(match)]; !ok {
|
||||
continue
|
||||
// ignore existing files that don't match the allowed extensions
|
||||
if f, err := os.Stat(match); !os.IsNotExist(err) && !f.IsDir() {
|
||||
if ext := filepath.Ext(match); ext != "" {
|
||||
if _, ok := extensions[ext]; !ok {
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue