aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/config.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2021-08-31 12:08:11 +0200
committerBjørn Erik Pedersen <[email protected]>2021-08-31 12:08:11 +0200
commita0489c2dfd3ceb4d0702de0da7a4af3eabce05e5 (patch)
tree4ad63fa9ab0b5ade625140682a11821e79a531a9 /hugolib/config.go
parent0fc2ce9e4bf0524994a861b7300e4332f6f8d390 (diff)
downloadhugo-a0489c2dfd3ceb4d0702de0da7a4af3eabce05e5.tar.gz
hugo-a0489c2dfd3ceb4d0702de0da7a4af3eabce05e5.zip
Avoid failing with "module not found" for hugo mod init and similar
Fixes #8940
Diffstat (limited to 'hugolib/config.go')
-rw-r--r--hugolib/config.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/hugolib/config.go b/hugolib/config.go
index aa9c81104..cdce19d6e 100644
--- a/hugolib/config.go
+++ b/hugolib/config.go
@@ -151,7 +151,7 @@ func LoadConfig(d ConfigSourceDescriptor, doWithConfig ...func(cfg config.Provid
return nil
}
- _, modulesConfigFiles, err := l.collectModules(modulesConfig, l.cfg, collectHook)
+ _, modulesConfigFiles, modulesCollectErr := l.collectModules(modulesConfig, l.cfg, collectHook)
if err != nil {
return l.cfg, configFiles, err
}
@@ -166,6 +166,10 @@ func LoadConfig(d ConfigSourceDescriptor, doWithConfig ...func(cfg config.Provid
return l.cfg, configFiles, err
}
+ if err == nil {
+ err = modulesCollectErr
+ }
+
return l.cfg, configFiles, err
}