Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,16 +308,6 @@ func (w *Watcher) listRecursive(name string) (map[string]os.FileInfo, error) {
return err
}

for _, f := range w.ffh {
err := f(info, path)
if err == ErrSkip {
return nil
}
if err != nil {
return err
}
}

// If path is ignored and it's a directory, skip the directory. If it's
// ignored and it's a single file, skip the file.
_, ignored := w.ignored[path]
Expand All @@ -333,6 +323,17 @@ func (w *Watcher) listRecursive(name string) (map[string]os.FileInfo, error) {
}
return nil
}

for _, f := range w.ffh {
err := f(info, path)
if err == ErrSkip {
return nil
}
if err != nil {
return err
}
}

// Add the path and it's info to the file list.
fileList[path] = info
return nil
Expand Down