diff --git a/commands/hugo.go b/commands/hugo.go index f250d4eff..3d26d8265 100644 --- a/commands/hugo.go +++ b/commands/hugo.go @@ -310,9 +310,10 @@ func InitializeConfig(subCmdVs ...*cobra.Command) error { if cmdV.Flags().Lookup("ignoreCache").Changed { viper.Set("IgnoreCache", IgnoreCache) } - if cmdV.Flags().Lookup("noTimes").Changed { - viper.Set("NoTimes", NoTimes) - } + } + + if hugoCmdV.Flags().Lookup("noTimes").Changed { + viper.Set("NoTimes", NoTimes) } if BaseURL != "" { diff --git a/commands/server.go b/commands/server.go index adcf6dff2..1ca39278b 100644 --- a/commands/server.go +++ b/commands/server.go @@ -148,6 +148,10 @@ func server(cmd *cobra.Command, args []string) error { viper.Set("PublishDir", "/") } + if serverCmd.Flags().Lookup("noTimes").Changed { + viper.Set("NoTimes", NoTimes) + } + if err := build(serverWatch); err != nil { return err }