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