Skip to content

Commit

Permalink
restored behavior of respecting config values unless set by command f…
Browse files Browse the repository at this point in the history
…lags. fixed gohugoio#116
  • Loading branch information
spf13 committed Nov 12, 2013
1 parent ef595ae commit 6017599
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions commands/hugo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 6017599

Please sign in to comment.