diff options
Diffstat (limited to 'hugofs/slice_fs.go')
-rw-r--r-- | hugofs/slice_fs.go | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/hugofs/slice_fs.go b/hugofs/slice_fs.go index 0f0d3850a..a9a3f1bbc 100644 --- a/hugofs/slice_fs.go +++ b/hugofs/slice_fs.go @@ -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 } |