ref: 6017599a3c0160d3f4daad671c1d6b1df47a4b3e
parent: ef595aedfce66caf2e8560b3605d38e95872e1ca
author: spf13 <[email protected]>
date: Tue Nov 12 04:38:43 EST 2013
restored behavior of respecting config values unless set by command flags. fixed #116
--- a/commands/hugo.go
+++ b/commands/hugo.go
@@ -71,9 +71,18 @@
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
}