mirror of
				https://github.com/gohugoio/hugo.git
				synced 2024-05-11 05:54:58 +00:00 
			
		
		
		
	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.
This commit is contained in:
		
				
					committed by
					
						
						Bjørn Erik Pedersen
					
				
			
			
				
	
			
			
			
						parent
						
							90d3fbf1da
						
					
				
				
					commit
					b5b6e81c02
				
			@@ -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)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user