diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-06-07 22:31:57 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-06-07 22:31:57 +0200 |
commit | bef5048580b38b0c29edef4eb8c67915033120e9 (patch) | |
tree | f9b256cda354507d20962a17c1d3d06384cd2348 /hugolib | |
parent | 49a104309d53af243b32443a59bdc2a6fc9beeef (diff) |
Revert "hugolib: Fix live-reload regression for add/removal of dirs"
Never mind. The "adding dir" scenario didn't work anyway, so that will need another fix.
This reverts commit 49a104309d53af243b32443a59bdc2a6fc9beeef.
Closes ##3325
Diffstat (limited to 'hugolib')
-rw-r--r-- | hugolib/site.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/hugolib/site.go b/hugolib/site.go index 0dfa3a30e..8740f11d5 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -753,6 +753,9 @@ func (s *Site) reProcess(events []fsnotify.Event) (whatChanged, error) { go pageConverter(pageChan, convertResults, wg2) } + sp := source.NewSourceSpec(s.Cfg, s.Fs) + fs := sp.NewFilesystem("") + for _, ev := range sourceChanged { // The incrementalReadCollator below will also make changes to the site's pages, // so we do this first to prevent races. @@ -775,6 +778,15 @@ func (s *Site) reProcess(events []fsnotify.Event) (whatChanged, error) { } } + // ignore files shouldn't be proceed + if fi, err := s.Fs.Source.Stat(ev.Name); err != nil { + continue + } else { + if ok, err := fs.ShouldRead(ev.Name, fi); err != nil || !ok { + continue + } + } + sourceReallyChanged = append(sourceReallyChanged, ev) } |