Rework the Destination filesystem to make --renderStaticToDisk work

See #9626
This commit is contained in:
Bjørn Erik Pedersen
2022-03-21 09:35:15 +01:00
parent b08193971a
commit d070bdf10f
75 changed files with 651 additions and 566 deletions

View File

@@ -70,13 +70,13 @@ func TestTransform(t *testing.T) {
// Verify that we publish the same file once only.
assertNoDuplicateWrites := func(c *qt.C, spec *Spec) {
c.Helper()
d := spec.Fs.Destination.(hugofs.DuplicatesReporter)
d := spec.Fs.PublishDir.(hugofs.DuplicatesReporter)
c.Assert(d.ReportDuplicates(), qt.Equals, "")
}
assertShouldExist := func(c *qt.C, spec *Spec, filename string, should bool) {
c.Helper()
exists, _ := helpers.Exists(filepath.FromSlash(filename), spec.Fs.Destination)
exists, _ := helpers.Exists(filepath.FromSlash(filename), spec.Fs.WorkingDirReadOnly)
c.Assert(exists, qt.Equals, should)
}