Add configFile(s) back to the watch list after RENAME event too
authorAnthony Fok <foka@debian.org>
Thu, 10 Jan 2019 22:57:30 +0000 (15:57 -0700)
committerAnthony Fok <foka@debian.org>
Thu, 10 Jan 2019 22:57:30 +0000 (15:57 -0700)
Alleviates #5205

commands/hugo.go

index b943568382d00dd81a8e5947249599fd88370479..3690c0ad519a7feeb3db71e0965ef81bb138a966 100644 (file)
@@ -764,7 +764,7 @@ func (c *commandeer) handleEvents(watcher *watcher.Batcher,
                        if ev.Op&fsnotify.Chmod == fsnotify.Chmod {
                                continue
                        }
-                       if ev.Op&fsnotify.Remove == fsnotify.Remove {
+                       if ev.Op&fsnotify.Remove == fsnotify.Remove || ev.Op&fsnotify.Rename == fsnotify.Rename {
                                for _, configFile := range c.configFiles {
                                        counter := 0
                                        for watcher.Add(configFile) != nil {