mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-28 22:19:59 +02:00
commands: Don't fail on template errors on go mod graph etc.
Fixes #8942
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user