commands: Start of flag cleaning

See #4598
This commit is contained in:
Bjørn Erik Pedersen 2018-04-09 17:20:18 +02:00
parent e614d8a57c
commit 1157fef859
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
4 changed files with 61 additions and 67 deletions

View file

@ -143,42 +143,8 @@ func (c *commandeer) loadConfig(running bool) error {
initializeFlags(cmdV, cfg)
}
if baseURL != "" {
cfg.Set("baseURL", baseURL)
}
if len(disableKinds) > 0 {
cfg.Set("disableKinds", disableKinds)
}
cfg.Set("logI18nWarnings", logI18nWarnings)
if theme != "" {
cfg.Set("theme", theme)
}
if themesDir != "" {
cfg.Set("themesDir", themesDir)
}
if destination != "" {
cfg.Set("publishDir", destination)
}
cfg.Set("workingDir", dir)
if contentDir != "" {
cfg.Set("contentDir", contentDir)
}
if layoutDir != "" {
cfg.Set("layoutDir", layoutDir)
}
if cacheDir != "" {
cfg.Set("cacheDir", cacheDir)
}
return nil
}
@ -244,7 +210,7 @@ func (c *commandeer) loadConfig(running bool) error {
return err
}
cacheDir = config.GetString("cacheDir")
cacheDir := config.GetString("cacheDir")
if cacheDir != "" {
if helpers.FilePathSeparator != cacheDir[len(cacheDir)-1:] {
cacheDir = cacheDir + helpers.FilePathSeparator