Browse Source

Load default config first, so missing values remain default

pull/34/head
Sam 5 years ago
parent
commit
05afd348d0
  1. 4
      cmdConfig.go

4
cmdConfig.go

@ -53,6 +53,10 @@ func readConfig(filepath ...string) (*Config, error) { @@ -53,6 +53,10 @@ func readConfig(filepath ...string) (*Config, error) {
var configFile string
var env bool
// Load default config first, this way any values missing from the provided config file will remain the default value
d := []byte(defaultConfig)
toml.Unmarshal(d, result)
switch len(filepath) {
case 0:
configFile, env = os.LookupEnv("KBTUI_CFG")

Loading…
Cancel
Save