hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit abc54080ec8c43e8989c081d934b59f0c9570c0b
parent a655e00d702dbc20b3961b131b33ab21841b043d
Author: Anthony Fok <foka@debian.org>
Date:   Wed, 15 Aug 2018 20:51:27 -0600

Add configFile(s) back to the watch list after REMOVE event

Fixes #4701

Diffstat:
Mcommands/hugo.go | 12++++++++++++
1 file changed, 12 insertions(+), 0 deletions(-)
diff --git a/commands/hugo.go b/commands/hugo.go
@@ -705,6 +705,18 @@ func (c *commandeer) newWatcher(dirList ...string) (*watcher.Batcher, error) {
 						if ev.Op&fsnotify.Chmod == fsnotify.Chmod {
 							continue
 						}
+						if ev.Op&fsnotify.Remove == fsnotify.Remove {
+							for _, configFile := range c.configFiles {
+								counter := 0
+								for watcher.Add(configFile) != nil {
+									counter++
+									if counter >= 100 {
+										break
+									}
+									time.Sleep(100 * time.Millisecond)
+								}
+							}
+						}
 						// Config file changed. Need full rebuild.
 						c.fullRebuild()
 						break