Skip to content

Commit

Permalink
Enable CHMOD events for rebuilding
Browse files Browse the repository at this point in the history
This is a workaround until this has been address by the upstream
project.
  • Loading branch information
zimmski committed Mar 15, 2020
1 parent 4f44227 commit 09b8dd8
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions commands/hugo.go
Original file line number Diff line number Diff line change
Expand Up @@ -1015,21 +1015,6 @@ func (c *commandeer) handleEvents(watcher *watcher.Batcher,
continue
}

// Write and rename operations are often followed by CHMOD.
// There may be valid use cases for rebuilding the site on CHMOD,
// but that will require more complex logic than this simple conditional.
// On OS X this seems to be related to Spotlight, see:
// https://github.com/go-fsnotify/fsnotify/issues/15
// A workaround is to put your site(s) on the Spotlight exception list,
// but that may be a little mysterious for most end users.
// So, for now, we skip reload on CHMOD.
// We do have to check for WRITE though. On slower laptops a Chmod
// could be aggregated with other important events, and we still want
// to rebuild on those
if ev.Op&(fsnotify.Chmod|fsnotify.Write|fsnotify.Create) == fsnotify.Chmod {
continue
}

walkAdder := func(path string, f hugofs.FileMetaInfo, err error) error {
if f.IsDir() {
c.logger.FEEDBACK.Println("adding created directory to watchlist", path)
Expand Down

0 comments on commit 09b8dd8

Please sign in to comment.