mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-18 21:11:19 +02:00
Rework the Destination filesystem to make --renderStaticToDisk work
See #9626
This commit is contained in:
@@ -22,7 +22,10 @@ import (
|
||||
"github.com/spf13/afero"
|
||||
)
|
||||
|
||||
var _ afero.Fs = (*md5HashingFs)(nil)
|
||||
var (
|
||||
_ afero.Fs = (*md5HashingFs)(nil)
|
||||
_ FilesystemUnwrapper = (*md5HashingFs)(nil)
|
||||
)
|
||||
|
||||
// FileHashReceiver will receive the filename an the content's MD5 sum on file close.
|
||||
type FileHashReceiver interface {
|
||||
@@ -45,6 +48,10 @@ func NewHashingFs(delegate afero.Fs, hashReceiver FileHashReceiver) afero.Fs {
|
||||
return &md5HashingFs{Fs: delegate, hashReceiver: hashReceiver}
|
||||
}
|
||||
|
||||
func (fs *md5HashingFs) UnwrapFilesystem() afero.Fs {
|
||||
return fs.Fs
|
||||
}
|
||||
|
||||
func (fs *md5HashingFs) Create(name string) (afero.File, error) {
|
||||
f, err := fs.Fs.Create(name)
|
||||
if err == nil {
|
||||
|
Reference in New Issue
Block a user