Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-08-31 18:02:51 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-08-31 23:16:12 +0300
commit7d1f806ecb3621ae7b545a686d04de4568814055 (patch)
tree857a0bc6c7b79bb8b312063eeb71d143f6371e26 /commands/hugo.go
parent04b59599613a62d378bf3710ac0eb06c9543b96d (diff)
commands: Don't fail on template errors on go mod graph etc.
Fixes #8942
Diffstat (limited to 'commands/hugo.go')
-rw-r--r--commands/hugo.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/commands/hugo.go b/commands/hugo.go
index 2b53d5cd6..4fd20a0f4 100644
--- a/commands/hugo.go
+++ b/commands/hugo.go
@@ -116,11 +116,11 @@ func Execute(args []string) Response {
}
// InitializeConfig initializes a config file with sensible default configuration flags.
-func initializeConfig(mustHaveConfigFile, running bool,
+func initializeConfig(mustHaveConfigFile, failOnInitErr, running bool,
h *hugoBuilderCommon,
f flagsToConfigHandler,
cfgInit func(c *commandeer) error) (*commandeer, error) {
- c, err := newCommandeer(mustHaveConfigFile, running, h, f, cfgInit)
+ c, err := newCommandeer(mustHaveConfigFile, failOnInitErr, running, h, f, cfgInit)
if err != nil {
return nil, err
}
@@ -128,7 +128,7 @@ func initializeConfig(mustHaveConfigFile, running bool,
return c, nil
}
-func (c *commandeer) createLogger(cfg config.Provider, running bool) (loggers.Logger, error) {
+func (c *commandeer) createLogger(cfg config.Provider) (loggers.Logger, error) {
var (
logHandle = ioutil.Discard
logThreshold = jww.LevelWarn
@@ -172,7 +172,7 @@ func (c *commandeer) createLogger(cfg config.Provider, running bool) (loggers.Lo
loggers.InitGlobalLogger(stdoutThreshold, logThreshold, outHandle, logHandle)
helpers.InitLoggers()
- return loggers.NewLogger(stdoutThreshold, logThreshold, outHandle, logHandle, running), nil
+ return loggers.NewLogger(stdoutThreshold, logThreshold, outHandle, logHandle, c.running), nil
}
func initializeFlags(cmd *cobra.Command, cfg config.Provider) {
@@ -792,7 +792,7 @@ func (c *commandeer) fullRebuild(changeType string) {
defer c.timeTrack(time.Now(), "Rebuilt")
c.commandeerHugoState = newCommandeerHugoState()
- err := c.loadConfig(true, true)
+ err := c.loadConfig()
if err != nil {
// Set the processing on pause until the state is recovered.
c.paused = true