Do not attempt to build if there is no config file

Fixes #5896
This commit is contained in:
Nick Krichevsky 2019-10-14 23:34:56 -04:00 committed by Bjørn Erik Pedersen
parent 6bcc5ad8b2
commit e6aa6edb4c

View file

@ -313,6 +313,8 @@ func (c *commandeer) loadConfig(mustHaveConfigFile, running bool) error {
return err return err
} }
} else if mustHaveConfigFile && len(configFiles) == 0 {
return hugolib.ErrNoConfigFile
} }
c.configFiles = configFiles c.configFiles = configFiles