mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05: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 {
|
if ev.Op&fsnotify.Chmod == fsnotify.Chmod {
|
||||||
continue
|
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.
|
// Config file changed. Need full rebuild.
|
||||||
c.fullRebuild()
|
c.fullRebuild()
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in a new issue