Don't create the public folder unless needed

Fixes #11031
This commit is contained in:
Bjørn Erik Pedersen
2023-05-28 10:07:03 +02:00
parent ffdbce5787
commit e96cdfe966
3 changed files with 11 additions and 6 deletions

View File

@@ -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{