diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-03-21 09:35:15 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-04-08 13:26:17 +0200 |
commit | d070bdf10f14d233288f7318a4e9f7555f070a65 (patch) | |
tree | fff8d59f98bdab3027bb45c4e10ca88594332872 /hugofs/nosymlink_fs.go | |
parent | b08193971a821fc27e549a73120c15e5e5186775 (diff) |
Rework the Destination filesystem to make --renderStaticToDisk work
See #9626
Diffstat (limited to 'hugofs/nosymlink_fs.go')
-rw-r--r-- | hugofs/nosymlink_fs.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/hugofs/nosymlink_fs.go b/hugofs/nosymlink_fs.go index ff9503257..d3cad5e74 100644 --- a/hugofs/nosymlink_fs.go +++ b/hugofs/nosymlink_fs.go @@ -30,6 +30,10 @@ func NewNoSymlinkFs(fs afero.Fs, logger loggers.Logger, allowFiles bool) afero.F return &noSymlinkFs{Fs: fs, logger: logger, allowFiles: allowFiles} } +var ( + _ FilesystemUnwrapper = (*noSymlinkFs)(nil) +) + // noSymlinkFs is a filesystem that prevents symlinking. type noSymlinkFs struct { allowFiles bool // block dirs only @@ -67,6 +71,10 @@ func (f *noSymlinkFile) Readdirnames(count int) ([]string, error) { return fileInfosToNames(dirs), nil } +func (fs *noSymlinkFs) UnwrapFilesystem() afero.Fs { + return fs.Fs +} + func (fs *noSymlinkFs) LstatIfPossible(name string) (os.FileInfo, bool, error) { return fs.stat(name) } |