Skip to content

Commit

Permalink
commands: Fix config reloading in Vim and similar
Browse files Browse the repository at this point in the history
The config path was simplified in Hugo 0.56.0 to support more config dirs/files (go.mod etc.),
and the new code path assumed that every file change would trigger a `Write` event.

This is not true for Vim etc. which triggers a `Chmod` and then a `Rename`.

Lesson learned: Be really careful changing Os/editor specific code without proper tests.

Fixes #6139
  • Loading branch information
bep committed Jul 30, 2019
1 parent e28bd4c commit 6eca0a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions commands/hugo.go
Expand Up @@ -914,12 +914,12 @@ func (c *commandeer) handleEvents(watcher *watcher.Batcher,
} }
} }


// A write event will follow.
continue
} }


// Config file(s) changed. Need full rebuild. // Config file(s) changed. Need full rebuild.
c.fullRebuild(configChangeType) c.fullRebuild(configChangeType)

return
} }
} }


Expand Down

0 comments on commit 6eca0a3

Please sign in to comment.