diff --git a/commands/hugo.go b/commands/hugo.go index 7cb1a4fc3..ec77047a2 100644 --- a/commands/hugo.go +++ b/commands/hugo.go @@ -17,7 +17,6 @@ package commands import ( "fmt" - "github.com/spf13/hugo/hugofs" "io/ioutil" "net/http" "os" @@ -27,6 +26,8 @@ import ( "sync" "time" + "github.com/spf13/hugo/hugofs" + "github.com/spf13/hugo/parser" flag "github.com/spf13/pflag" @@ -318,6 +319,8 @@ func loadDefaultSettings() { // A Hugo command that calls initCoreCommonFlags() can pass itself // as an argument to have its command-line flags processed here. func InitializeConfig(subCmdVs ...*cobra.Command) error { + viper.AutomaticEnv() + viper.SetEnvPrefix("hugo") viper.SetConfigFile(cfgFile) // See https://github.com/spf13/viper/issues/73#issuecomment-126970794 if source == "" {