summaryrefslogtreecommitdiffstats
path: root/hugolib
diff options
context:
space:
mode:
authorxofyarg <xofyarg@users.noreply.github.com>2017-04-22 21:38:54 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-04-22 22:38:54 +0200
commitb5b6e81c0269abf9b0f4bc6a127744a25344e5c6 (patch)
tree726ffb2aeb2ddb86b4f426a25d03b73efcb04e46 /hugolib
parent90d3fbf1da93a279cfe994a226ae82cf5441deab (diff)
hugolib: Ignore non-source files on partial rebuild
Partial rebuild does not have the same logic as normal rebuild on selecting which file to build. This change makes it possible to share the file select logic between two kinds of build. Fix #3325.
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/site.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/hugolib/site.go b/hugolib/site.go
index 3b7d47533..f2ebee4cc 100644
--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -728,6 +728,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.
@@ -750,6 +753,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)
}