mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
parent
49336bfc58
commit
b1016d2e26
4 changed files with 7 additions and 3 deletions
|
@ -136,6 +136,10 @@ type rootCommand struct {
|
||||||
cfgDir string
|
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) {
|
func (r *rootCommand) Build(cd *simplecobra.Commandeer, bcfg hugolib.BuildCfg, cfg config.Provider) (*hugolib.HugoSites, error) {
|
||||||
h, err := r.Hugo(cfg)
|
h, err := r.Hugo(cfg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -212,7 +212,7 @@ func (c *configMountsCommand) Run(ctx context.Context, cd *simplecobra.Commandee
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, m := range conf.configs.Modules {
|
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
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ func newEnvCommand() simplecobra.Commander {
|
||||||
r.Printf("GOARCH=%q\n", runtime.GOARCH)
|
r.Printf("GOARCH=%q\n", runtime.GOARCH)
|
||||||
r.Printf("GOVERSION=%q\n", runtime.Version())
|
r.Printf("GOVERSION=%q\n", runtime.Version())
|
||||||
|
|
||||||
if r.verbose {
|
if r.isVerbose() {
|
||||||
deps := hugo.GetDependencyList()
|
deps := hugo.GetDependencyList()
|
||||||
for _, dep := range deps {
|
for _, dep := range deps {
|
||||||
r.Printf("%s\n", dep)
|
r.Printf("%s\n", dep)
|
||||||
|
|
|
@ -1012,7 +1012,7 @@ func (c *hugoBuilder) loadConfig(cd *simplecobra.Commandeer, running bool) error
|
||||||
cfg.Set("internal", maps.Params{
|
cfg.Set("internal", maps.Params{
|
||||||
"running": running,
|
"running": running,
|
||||||
"watch": watch,
|
"watch": watch,
|
||||||
"verbose": c.r.verbose,
|
"verbose": c.r.isVerbose(),
|
||||||
})
|
})
|
||||||
|
|
||||||
conf, err := c.r.ConfigFromProvider(c.r.configVersionID.Load(), flagsToCfg(cd, cfg))
|
conf, err := c.r.ConfigFromProvider(c.r.configVersionID.Load(), flagsToCfg(cd, cfg))
|
||||||
|
|
Loading…
Reference in a new issue