diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-03-21 09:35:15 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-04-08 13:26:17 +0200 |
commit | d070bdf10f14d233288f7318a4e9f7555f070a65 (patch) | |
tree | fff8d59f98bdab3027bb45c4e10ca88594332872 /commands/hugo.go | |
parent | b08193971a821fc27e549a73120c15e5e5186775 (diff) |
Rework the Destination filesystem to make --renderStaticToDisk work
See #9626
Diffstat (limited to 'commands/hugo.go')
-rw-r--r-- | commands/hugo.go | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/commands/hugo.go b/commands/hugo.go index 21140fa43..9033fac90 100644 --- a/commands/hugo.go +++ b/commands/hugo.go @@ -508,7 +508,7 @@ func (c *commandeer) build() error { c.hugo().PrintProcessingStats(os.Stdout) fmt.Println() - if createCounter, ok := c.destinationFs.(hugofs.DuplicatesReporter); ok { + if createCounter, ok := c.publishDirFs.(hugofs.DuplicatesReporter); ok { dupes := createCounter.ReportDuplicates() if dupes != "" { c.logger.Warnln("Duplicate target paths:", dupes) @@ -634,11 +634,7 @@ func chmodFilter(dst, src os.FileInfo) bool { } func (c *commandeer) copyStaticTo(sourceFs *filesystems.SourceFilesystem) (uint64, error) { - publishDir := c.hugo().PathSpec.PublishDir - // If root, remove the second '/' - if publishDir == "//" { - publishDir = helpers.FilePathSeparator - } + publishDir := helpers.FilePathSeparator if sourceFs.PublishFolder != "" { publishDir = filepath.Join(publishDir, sourceFs.PublishFolder) @@ -651,9 +647,9 @@ func (c *commandeer) copyStaticTo(sourceFs *filesystems.SourceFilesystem) (uint6 syncer.NoChmod = c.Cfg.GetBool("noChmod") syncer.ChmodFilter = chmodFilter syncer.SrcFs = fs - syncer.DestFs = c.Fs.Destination + syncer.DestFs = c.Fs.PublishDir if c.renderStaticToDisk { - syncer.DestFs = c.Fs.DestinationStatic + syncer.DestFs = c.Fs.PublishDirStatic } // Now that we are using a unionFs for the static directories // We can effectively clean the publishDir on initial sync |