summaryrefslogtreecommitdiffstats
path: root/commands/hugo.go
diff options
context:
space:
mode:
authorAnthony Fok <foka@debian.org>2018-08-15 20:51:27 -0600
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-08-16 16:11:57 +0200
commitabc54080ec8c43e8989c081d934b59f0c9570c0b (patch)
tree964d752200eaf2ae865f9e9e60ed140cd87aed15 /commands/hugo.go
parenta655e00d702dbc20b3961b131b33ab21841b043d (diff)
Add configFile(s) back to the watch list after REMOVE event
Fixes #4701
Diffstat (limited to 'commands/hugo.go')
-rw-r--r--commands/hugo.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/commands/hugo.go b/commands/hugo.go
index fc8dced74..a97c28294 100644
--- 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