summaryrefslogtreecommitdiffhomepage
path: root/hugolib/integrationtest_builder.go
diff options
context:
space:
mode:
Diffstat (limited to 'hugolib/integrationtest_builder.go')
-rw-r--r--hugolib/integrationtest_builder.go16
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