summaryrefslogtreecommitdiffstats
path: root/tpl/os
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-04-08 15:15:26 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-04-10 13:49:31 +0200
commit30c2e54c25f6c3a942080f30be49712adda27586 (patch)
tree6805e432456f92623db0b1c862879cee54693481 /tpl/os
parent3117e5859509e909298153972ab6f700af577f92 (diff)
Replace all usage of CopyOnWriteFs with OverlayFs
Fixes #9761
Diffstat (limited to 'tpl/os')
-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
}