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/stacktracer_fs.go
parentb08193971a821fc27e549a73120c15e5e5186775 (diff)
Rework the Destination filesystem to make --renderStaticToDisk work
See #9626
Diffstat (limited to 'hugofs/stacktracer_fs.go')
-rw-r--r--hugofs/stacktracer_fs.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/hugofs/stacktracer_fs.go b/hugofs/stacktracer_fs.go
index d3769f903..4411dbfde 100644
--- a/hugofs/stacktracer_fs.go
+++ b/hugofs/stacktracer_fs.go
@@ -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)