Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-03-21 11:35:15 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-04-08 14:26:17 +0300
commitd070bdf10f14d233288f7318a4e9f7555f070a65 (patch)
treefff8d59f98bdab3027bb45c4e10ca88594332872 /hugofs/slice_fs.go
parentb08193971a821fc27e549a73120c15e5e5186775 (diff)
Rework the Destination filesystem to make --renderStaticToDisk work
See #9626
Diffstat (limited to 'hugofs/slice_fs.go')
-rw-r--r--hugofs/slice_fs.go15
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
}