mirror of
https://github.com/facundoolano/jorge.git
synced 2024-12-25 21:58:28 +01:00
don't skip reload on chmod if it's also write event (#38)
This commit is contained in:
parent
fdec423187
commit
6a1dc5eced
1 changed files with 3 additions and 2 deletions
|
@ -99,10 +99,11 @@ func runWatcher(config *config.Config, broker *EventBroker) (*fsnotify.Watcher,
|
|||
|
||||
go func() {
|
||||
for event := range watcher.Events {
|
||||
// chmod events are noisy, ignore them.
|
||||
// chmod events are noisy, ignore them. But not if they are also a write event.
|
||||
isChmod := event.Has(fsnotify.Chmod) && !event.Has(fsnotify.Write)
|
||||
// Also ignore dot file events, which are usually spurious (e.g .DS_Store, emacs temp files)
|
||||
isDotFile := strings.HasPrefix(filepath.Base(event.Name), ".")
|
||||
if event.Has(fsnotify.Chmod) || isDotFile {
|
||||
if isChmod || isDotFile {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue