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() {
Config = hugolib.SetupConfig(&CfgFile, &Source)
Config.BuildDrafts = Draft
Config.UglyUrls = UglyUrls
Config.Verbose = Verbose
if HugoCmd.PersistentFlags().Lookup("build-drafts").Changed {
Config.BuildDrafts = Draft
}
if HugoCmd.PersistentFlags().Lookup("uglyurls").Changed {
Config.UglyUrls = UglyUrls
}
if HugoCmd.PersistentFlags().Lookup("verbose").Changed {
Config.Verbose = Verbose
}
if BaseUrl != "" {
Config.BaseUrl = BaseUrl
}