mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +02:00
Rework the Destination filesystem to make --renderStaticToDisk work
See #9626
This commit is contained in:
@@ -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()))
|
||||
}
|
||||
|
@@ -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()))
|
||||
}
|
||||
|
@@ -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
|
||||
}
|
||||
|
@@ -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)})
|
||||
|
Reference in New Issue
Block a user