commands: Don't fail on template errors on go mod graph etc.

Fixes #8942
This commit is contained in:
Bjørn Erik Pedersen
2021-08-31 17:02:51 +02:00
parent 04b5959961
commit 7d1f806ecb
12 changed files with 45 additions and 27 deletions

View File

@@ -299,6 +299,9 @@ func newHugoSites(cfg deps.DepsCfg, sites ...*Site) (*HugoSites, error) {
return nil, errors.New("Cannot provide Language in Cfg when sites are provided")
}
// Return error at the end. Make the caller decide if it's fatal or not.
var initErr error
langConfig, err := newMultiLingualFromSites(cfg.Cfg, sites...)
if err != nil {
return nil, errors.Wrap(err, "failed to create language config")
@@ -376,7 +379,7 @@ func newHugoSites(cfg deps.DepsCfg, sites ...*Site) (*HugoSites, error) {
var l configLoader
if err := l.applyDeps(cfg, sites...); err != nil {
return nil, errors.Wrap(err, "add site dependencies")
initErr = errors.Wrap(err, "add site dependencies")
}
h.Deps = sites[0].Deps
@@ -393,7 +396,7 @@ func newHugoSites(cfg deps.DepsCfg, sites ...*Site) (*HugoSites, error) {
h.ContentChanges = contentChangeTracker
}
return h, nil
return h, initErr
}
func (h *HugoSites) loadGitInfo() error {