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 Jan 30, 2018
1 parent feeed07 commit d6f31ce
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 @@ -1073,21 +1073,6 @@ func (c *commandeer) newWatcher(dirList ...string) (*watcher.Batcher, error) {
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 os.FileInfo, err error) error {
if f.IsDir() {
c.Logger.FEEDBACK.Println("adding created directory to watchlist", path)
Expand Down

0 comments on commit d6f31ce

Please sign in to comment.