aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugofs/fs.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2023-05-28 10:07:03 +0200
committerBjørn Erik Pedersen <[email protected]>2023-05-28 12:55:44 +0200
commite96cdfe9664cb38c3e16cc00cc630cf6f258d547 (patch)
treed3edecddc0b6a465fecf1d2b60a391236c541e0b /hugofs/fs.go
parentffdbce5787a45e8537b7a77515ca06e4deee2504 (diff)
downloadhugo-e96cdfe9664cb38c3e16cc00cc630cf6f258d547.tar.gz
hugo-e96cdfe9664cb38c3e16cc00cc630cf6f258d547.zip
Don't create the public folder unless needed
Fixes #11031
Diffstat (limited to 'hugofs/fs.go')
-rw-r--r--hugofs/fs.go6
1 files changed, 1 insertions, 5 deletions
diff --git a/hugofs/fs.go b/hugofs/fs.go
index 5dae3a78a..ce92a626d 100644
--- a/hugofs/fs.go
+++ b/hugofs/fs.go
@@ -116,13 +116,9 @@ func newFs(source, destination afero.Fs, workingDir, publishDir string) *Fs {
panic("workingDir is too short")
}
+ // If this does not exist, it will be created later.
absPublishDir := paths.AbsPathify(workingDir, publishDir)
- // Make sure we always have the /public folder ready to use.
- if err := source.MkdirAll(absPublishDir, 0777); err != nil && !os.IsExist(err) {
- panic(err)
- }
-
pubFs := afero.NewBasePathFs(destination, absPublishDir)
return &Fs{