Skip to content

Commit

Permalink
Remove the decorator from the fs used in ReadDir
Browse files Browse the repository at this point in the history
There have been a site breakage reported in the wild after 0.93.1. With this commit we shoudl be back to how it behaved in 0.92.2.

Closes gohugoio#9609
  • Loading branch information
bep committed Mar 7, 2022
1 parent 970f385 commit 01d100d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hugolib/filesystems/basefs.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ type BaseFs struct {
// This usually maps to /my-project/public.
PublishFs afero.Fs

// A read-only filesystem from the project workDir (no theme here).
// A read-only filesystem starting from the project workDir.
WorkDir afero.Fs

theBigFs *filesystemsCollector
Expand Down Expand Up @@ -438,7 +438,9 @@ func NewBase(p *paths.Paths, logger loggers.Logger, options ...func(*BaseFs) err

publishFs := hugofs.NewBaseFileDecorator(afero.NewBasePathFs(fs.Destination, p.AbsPublishDir))
sourceFs := hugofs.NewBaseFileDecorator(afero.NewBasePathFs(fs.Source, p.WorkingDir))
workDir := hugofs.NewBaseFileDecorator(afero.NewBasePathFs(afero.NewReadOnlyFs(fs.Source), p.WorkingDir))

// Same as sourceFs, but no decoration. This is what's used by os.ReadDir etc.
workDir := afero.NewBasePathFs(afero.NewReadOnlyFs(fs.Source), p.WorkingDir)

b := &BaseFs{
SourceFs: sourceFs,
Expand Down

0 comments on commit 01d100d

Please sign in to comment.