restored behavior of respecting config values unless set by command flags. fixed #116

This commit is contained in:
spf13 2013-11-12 09:38:43 -05:00
parent ef595aedfc
commit 6017599a3c

View file

@ -71,9 +71,18 @@ func init() {
func InitializeConfig() { func InitializeConfig() {
Config = hugolib.SetupConfig(&CfgFile, &Source) Config = hugolib.SetupConfig(&CfgFile, &Source)
Config.BuildDrafts = Draft
Config.UglyUrls = UglyUrls if HugoCmd.PersistentFlags().Lookup("build-drafts").Changed {
Config.Verbose = Verbose Config.BuildDrafts = Draft
}
if HugoCmd.PersistentFlags().Lookup("uglyurls").Changed {
Config.UglyUrls = UglyUrls
}
if HugoCmd.PersistentFlags().Lookup("verbose").Changed {
Config.Verbose = Verbose
}
if BaseUrl != "" { if BaseUrl != "" {
Config.BaseUrl = BaseUrl Config.BaseUrl = BaseUrl
} }