Fix htimes /: operation not permitted error on config changes

Regression introduced in v0.104.1.
This commit is contained in:
Bjørn Erik Pedersen 2022-09-29 11:37:38 +02:00
parent 2171e3c9a5
commit 4611b6920b

View file

@ -79,8 +79,8 @@ type commandeer struct {
changeDetector *fileChangeDetector changeDetector *fileChangeDetector
// We need to reuse these on server rebuilds. // We need to reuse these on server rebuilds.
// These 2 will be different if --renderStaticToDisk is set.
publishDirFs afero.Fs publishDirFs afero.Fs
publishDirStaticFs afero.Fs
publishDirServerFs afero.Fs publishDirServerFs afero.Fs
h *hugoBuilderCommon h *hugoBuilderCommon
@ -170,6 +170,7 @@ func (c *commandeer) Set(key string, value any) {
func (c *commandeer) initFs(fs *hugofs.Fs) error { func (c *commandeer) initFs(fs *hugofs.Fs) error {
c.publishDirFs = fs.PublishDir c.publishDirFs = fs.PublishDir
c.publishDirStaticFs = fs.PublishDirStatic
c.publishDirServerFs = fs.PublishDirServer c.publishDirServerFs = fs.PublishDirServer
c.DepsCfg.Fs = fs c.DepsCfg.Fs = fs
@ -426,6 +427,7 @@ func (c *commandeer) loadConfig() error {
if c.publishDirFs != nil { if c.publishDirFs != nil {
// Need to reuse the destination on server rebuilds. // Need to reuse the destination on server rebuilds.
fs.PublishDir = c.publishDirFs fs.PublishDir = c.publishDirFs
fs.PublishDirStatic = c.publishDirStaticFs
fs.PublishDirServer = c.publishDirServerFs fs.PublishDirServer = c.publishDirServerFs
} else { } else {
if c.renderStaticToDisk { if c.renderStaticToDisk {