func (w *Watcher) rebuildRequired(ev notify.EventInfo, listener Listener) bool { // Ignore changes to dotfiles. if strings.HasPrefix(path.Base(ev.Path()), ".") { return false } if dl, ok := listener.(DiscerningListener); ok { if !dl.WatchDir(path.Base(path.Dir(ev.Path()))) || !dl.WatchFile(path.Base(ev.Path())) { return false } } return true }
// newEvent TODO(rjeczalik) func newEvent(ei notify.EventInfo) Event { return Event{ Path: ei.Path(), Event: mapping[ei.Event()], } }
func filterFiles(event notify.EventInfo) bool { path := event.Path() r := regexp.MustCompile(filesToFilter) return !r.MatchString(path) }