diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-05-27 13:23:37 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-05-27 19:11:16 +0200 |
commit | dd9eaf19fdeb37ce5861405beceaf018faac6386 (patch) | |
tree | 66fb496dc02dab4af49e924af1dce1d7e6df06ee /hugolib/integrationtest_builder.go | |
parent | 46a2ea6d0d3aba04213362fc72f5a3a28e3c3404 (diff) | |
download | hugo-dd9eaf19fdeb37ce5861405beceaf018faac6386.tar.gz hugo-dd9eaf19fdeb37ce5861405beceaf018faac6386.zip |
Don't use the baseURL /path as part of the resource cache key
As that prevents Hugo projects with sub paths in their `baseURL` to use themes with cached resources.
Fixes #9787
Diffstat (limited to 'hugolib/integrationtest_builder.go')
-rw-r--r-- | hugolib/integrationtest_builder.go | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/hugolib/integrationtest_builder.go b/hugolib/integrationtest_builder.go index 0ec202f89..df51b37c3 100644 --- a/hugolib/integrationtest_builder.go +++ b/hugolib/integrationtest_builder.go @@ -41,13 +41,15 @@ func NewIntegrationTestBuilder(conf IntegrationTestConfig) *IntegrationTestBuild } if conf.NeedsOsFS { - tempDir, clean, err := htesting.CreateTempDir(hugofs.Os, "hugo-integration-test") - c.Assert(err, qt.IsNil) - conf.WorkingDir = filepath.Join(tempDir, conf.WorkingDir) - if !conf.PrintAndKeepTempDir { - c.Cleanup(clean) - } else { - fmt.Println("\nUsing WorkingDir dir:", conf.WorkingDir) + if !filepath.IsAbs(conf.WorkingDir) { + tempDir, clean, err := htesting.CreateTempDir(hugofs.Os, "hugo-integration-test") + c.Assert(err, qt.IsNil) + conf.WorkingDir = filepath.Join(tempDir, conf.WorkingDir) + if !conf.PrintAndKeepTempDir { + c.Cleanup(clean) + } else { + fmt.Println("\nUsing WorkingDir dir:", conf.WorkingDir) + } } } else if conf.WorkingDir == "" { conf.WorkingDir = helpers.FilePathSeparator |