summaryrefslogtreecommitdiffstats
path: root/tpl
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-03-21 09:35:15 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-04-08 13:26:17 +0200
commitd070bdf10f14d233288f7318a4e9f7555f070a65 (patch)
treefff8d59f98bdab3027bb45c4e10ca88594332872 /tpl
parentb08193971a821fc27e549a73120c15e5e5186775 (diff)
Rework the Destination filesystem to make --renderStaticToDisk work
See #9626
Diffstat (limited to 'tpl')
-rw-r--r--tpl/collections/collections_test.go4
-rw-r--r--tpl/data/resources_test.go9
-rw-r--r--tpl/images/images.go2
-rw-r--r--tpl/images/images_test.go2
4 files changed, 6 insertions, 11 deletions
diff --git a/tpl/collections/collections_test.go b/tpl/collections/collections_test.go
index 3aadfae3b..8fc43318d 100644
--- a/tpl/collections/collections_test.go
+++ b/tpl/collections/collections_test.go
@@ -985,7 +985,5 @@ func newDeps(cfg config.Provider) *deps.Deps {
}
func newTestNs() *Namespace {
- v := config.New()
- v.Set("contentDir", "content")
- return New(newDeps(v))
+ return New(newDeps(config.NewWithTestDefaults()))
}
diff --git a/tpl/data/resources_test.go b/tpl/data/resources_test.go
index e825c2be1..44f0f9ac3 100644
--- a/tpl/data/resources_test.go
+++ b/tpl/data/resources_test.go
@@ -40,7 +40,7 @@ import (
func TestScpGetLocal(t *testing.T) {
t.Parallel()
- v := config.New()
+ v := config.NewWithTestDefaults()
fs := hugofs.NewMem(v)
ps := helpers.FilePathSeparator
@@ -145,9 +145,8 @@ func TestScpGetRemoteParallel(t *testing.T) {
c.Assert(err, qt.IsNil)
for _, ignoreCache := range []bool{false} {
- cfg := config.New()
+ cfg := config.NewWithTestDefaults()
cfg.Set("ignoreCache", ignoreCache)
- cfg.Set("contentDir", "content")
ns := New(newDeps(cfg))
ns.client = cl
@@ -227,7 +226,5 @@ func newDeps(cfg config.Provider) *deps.Deps {
}
func newTestNs() *Namespace {
- v := config.New()
- v.Set("contentDir", "content")
- return New(newDeps(v))
+ return New(newDeps(config.NewWithTestDefaults()))
}
diff --git a/tpl/images/images.go b/tpl/images/images.go
index aae8b3c2b..ad3b5d9b3 100644
--- a/tpl/images/images.go
+++ b/tpl/images/images.go
@@ -74,7 +74,7 @@ func (ns *Namespace) Config(path any) (image.Config, error) {
return config, nil
}
- f, err := ns.deps.Fs.WorkingDir.Open(filename)
+ f, err := ns.deps.Fs.WorkingDirReadOnly.Open(filename)
if err != nil {
return image.Config{}, err
}
diff --git a/tpl/images/images_test.go b/tpl/images/images_test.go
index c142801b7..aa6896521 100644
--- a/tpl/images/images_test.go
+++ b/tpl/images/images_test.go
@@ -82,7 +82,7 @@ func TestNSConfig(t *testing.T) {
t.Parallel()
c := qt.New(t)
- v := config.New()
+ v := config.NewWithTestDefaults()
v.Set("workingDir", "/a/b")
ns := New(&deps.Deps{Fs: hugofs.NewMem(v)})