diff options
Diffstat (limited to 'commands')
-rw-r--r-- | commands/commandeer.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/commands/commandeer.go b/commands/commandeer.go index bac96fa7a..b2a995ae6 100644 --- a/commands/commandeer.go +++ b/commands/commandeer.go @@ -309,7 +309,12 @@ func (c *commandeer) loadConfig(mustHaveConfigFile, running bool) error { doWithConfig) if err != nil { - return err + // We should improve the error handling here, + // but with hugo mod init and similar there is a chicken and egg situation + // with modules already configured in config.toml, so ignore those errors. + if mustHaveConfigFile || !moduleNotFoundRe.MatchString(err.Error()) { + return err + } } else if mustHaveConfigFile && len(configFiles) == 0 { return hugolib.ErrNoConfigFile } |