aboutsummaryrefslogtreecommitdiffhomepage
path: root/tpl/os/os.go
diff options
context:
space:
mode:
Diffstat (limited to 'tpl/os/os.go')
-rw-r--r--tpl/os/os.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/tpl/os/os.go b/tpl/os/os.go
index 4fa470952..e7fd05939 100644
--- a/tpl/os/os.go
+++ b/tpl/os/os.go
@@ -21,6 +21,7 @@ import (
_os "os"
"path/filepath"
+ "github.com/bep/overlayfs"
"github.com/gohugoio/hugo/deps"
"github.com/spf13/afero"
"github.com/spf13/cast"
@@ -32,7 +33,12 @@ func New(d *deps.Deps) *Namespace {
// The docshelper script does not have or need all the dependencies set up.
if d.PathSpec != nil {
- readFileFs = afero.NewReadOnlyFs(afero.NewCopyOnWriteFs(d.PathSpec.BaseFs.Content.Fs, d.PathSpec.BaseFs.Work))
+ readFileFs = overlayfs.New(overlayfs.Options{
+ Fss: []afero.Fs{
+ d.PathSpec.BaseFs.Work,
+ d.PathSpec.BaseFs.Content.Fs,
+ },
+ })
// See #9599
workFs = d.PathSpec.BaseFs.WorkDir
}