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

@@ -24,9 +24,10 @@ import (
)
var (
_ afero.Fs = (*SliceFs)(nil)
_ afero.Lstater = (*SliceFs)(nil)
_ afero.File = (*sliceDir)(nil)
_ afero.Fs = (*SliceFs)(nil)
_ afero.Lstater = (*SliceFs)(nil)
_ FilesystemsUnwrapper = (*SliceFs)(nil)
_ afero.File = (*sliceDir)(nil)
)
func NewSliceFs(dirs ...FileMetaInfo) (afero.Fs, error) {
@@ -52,6 +53,14 @@ type SliceFs struct {
dirs []FileMetaInfo
}
func (fs *SliceFs) UnwrapFilesystems() []afero.Fs {
var fss []afero.Fs
for _, dir := range fs.dirs {
fss = append(fss, dir.Meta().Fs)
}
return fss
}
func (fs *SliceFs) Chmod(n string, m os.FileMode) error {
return syscall.EPERM
}