diff options
-rw-r--r-- | commands/commandeer.go | 4 | ||||
-rw-r--r-- | commands/config.go | 2 | ||||
-rw-r--r-- | commands/env.go | 2 | ||||
-rw-r--r-- | commands/hugobuilder.go | 2 |
4 files changed, 7 insertions, 3 deletions
diff --git a/commands/commandeer.go b/commands/commandeer.go index c2b26b5ec..26bd25c01 100644 --- a/commands/commandeer.go +++ b/commands/commandeer.go @@ -136,6 +136,10 @@ type rootCommand struct { cfgDir string } +func (r *rootCommand) isVerbose() bool { + return r.logger.Level() <= logg.LevelInfo +} + func (r *rootCommand) Build(cd *simplecobra.Commandeer, bcfg hugolib.BuildCfg, cfg config.Provider) (*hugolib.HugoSites, error) { h, err := r.Hugo(cfg) if err != nil { diff --git a/commands/config.go b/commands/config.go index fe20196aa..9bf1c0961 100644 --- a/commands/config.go +++ b/commands/config.go @@ -212,7 +212,7 @@ func (c *configMountsCommand) Run(ctx context.Context, cd *simplecobra.Commandee } for _, m := range conf.configs.Modules { - if err := parser.InterfaceToConfig(&configModMounts{m: m, verbose: r.verbose}, metadecoders.JSON, os.Stdout); err != nil { + if err := parser.InterfaceToConfig(&configModMounts{m: m, verbose: r.isVerbose()}, metadecoders.JSON, os.Stdout); err != nil { return err } } diff --git a/commands/env.go b/commands/env.go index a6db551e9..0652deb87 100644 --- a/commands/env.go +++ b/commands/env.go @@ -32,7 +32,7 @@ func newEnvCommand() simplecobra.Commander { r.Printf("GOARCH=%q\n", runtime.GOARCH) r.Printf("GOVERSION=%q\n", runtime.Version()) - if r.verbose { + if r.isVerbose() { deps := hugo.GetDependencyList() for _, dep := range deps { r.Printf("%s\n", dep) diff --git a/commands/hugobuilder.go b/commands/hugobuilder.go index 60e558c70..71992e409 100644 --- a/commands/hugobuilder.go +++ b/commands/hugobuilder.go @@ -1012,7 +1012,7 @@ func (c *hugoBuilder) loadConfig(cd *simplecobra.Commandeer, running bool) error cfg.Set("internal", maps.Params{ "running": running, "watch": watch, - "verbose": c.r.verbose, + "verbose": c.r.isVerbose(), }) conf, err := c.r.ConfigFromProvider(c.r.configVersionID.Load(), flagsToCfg(cd, cfg)) |