aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/integrationtest_builder.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2023-01-15 18:45:51 +0100
committerBjørn Erik Pedersen <[email protected]>2023-01-16 15:34:16 +0100
commitf38a2fbd2e4de7f095a833b448cb8bc053955ce2 (patch)
tree3c88d0c12efa09ef3cc189a5859620b771004c7f /hugolib/integrationtest_builder.go
parent6a579ebac3a81df61f22988e3eb55f7cb35ce523 (diff)
downloadhugo-f38a2fbd2e4de7f095a833b448cb8bc053955ce2.tar.gz
hugo-f38a2fbd2e4de7f095a833b448cb8bc053955ce2.zip
Make hugo.toml the new config.toml
Both will of course work, but hugo.toml will win if both are set. We should have done this a long time ago, of course, but the reason I'm picking this up now is that my VS Code setup by default picks up some JSON config schema from some random other software which also names its config files config.toml. Fixes #8979
Diffstat (limited to 'hugolib/integrationtest_builder.go')
-rw-r--r--hugolib/integrationtest_builder.go15
1 files changed, 10 insertions, 5 deletions
diff --git a/hugolib/integrationtest_builder.go b/hugolib/integrationtest_builder.go
index 9dcfe4830..5b457893d 100644
--- a/hugolib/integrationtest_builder.go
+++ b/hugolib/integrationtest_builder.go
@@ -301,13 +301,18 @@ func (s *IntegrationTestBuilder) initBuilder() error {
s.Assert(afero.WriteFile(afs, filename, data, 0666), qt.IsNil)
}
+ configDirFilename := filepath.Join(s.Cfg.WorkingDir, "config")
+ if _, err := afs.Stat(configDirFilename); err != nil {
+ configDirFilename = ""
+ }
+
cfg, _, err := LoadConfig(
ConfigSourceDescriptor{
- WorkingDir: s.Cfg.WorkingDir,
- Fs: afs,
- Logger: logger,
- Environ: []string{},
- Filename: "config.toml",
+ WorkingDir: s.Cfg.WorkingDir,
+ AbsConfigDir: configDirFilename,
+ Fs: afs,
+ Logger: logger,
+ Environ: []string{},
},
func(cfg config.Provider) error {
return nil