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

@@ -33,10 +33,18 @@ type DuplicatesReporter interface {
ReportDuplicates() string
}
var (
_ FilesystemUnwrapper = (*createCountingFs)(nil)
)
func NewCreateCountingFs(fs afero.Fs) afero.Fs {
return &createCountingFs{Fs: fs, fileCount: make(map[string]int)}
}
func (fs *createCountingFs) UnwrapFilesystem() afero.Fs {
return fs.Fs
}
// ReportDuplicates reports filenames written more than once.
func (c *createCountingFs) ReportDuplicates() string {
c.mu.Lock()