mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-23 14:12:57 +00:00
Add configFile(s) back to the watch list after REMOVE event
Fixes #4701
This commit is contained in:
parent
a655e00d70
commit
abc54080ec
1 changed files with 12 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue