mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-25 22:00:58 +02:00
Rework the Destination filesystem to make --renderStaticToDisk work
See #9626
This commit is contained in:
@@ -24,8 +24,11 @@ import (
|
||||
"github.com/spf13/afero"
|
||||
)
|
||||
|
||||
// Make sure we don't accidentally use this in the real Hugo.
|
||||
var _ types.DevMarker = (*stacktracerFs)(nil)
|
||||
var (
|
||||
// Make sure we don't accidentally use this in the real Hugo.
|
||||
_ types.DevMarker = (*stacktracerFs)(nil)
|
||||
_ FilesystemUnwrapper = (*stacktracerFs)(nil)
|
||||
)
|
||||
|
||||
// NewStacktracerFs wraps the given fs printing stack traces for file creates
|
||||
// matching the given regexp pattern.
|
||||
@@ -45,6 +48,10 @@ type stacktracerFs struct {
|
||||
func (fs *stacktracerFs) DevOnly() {
|
||||
}
|
||||
|
||||
func (fs *stacktracerFs) UnwrapFilesystem() afero.Fs {
|
||||
return fs.Fs
|
||||
}
|
||||
|
||||
func (fs *stacktracerFs) onCreate(filename string) {
|
||||
if fs.re.MatchString(filename) {
|
||||
trace := make([]byte, 1500)
|
||||
|
Reference in New Issue
Block a user