|
|
|
@ -1050,7 +1050,7 @@ func (cfg *Cfg) Load(args CommandLineArgs) error { |
|
|
|
|
|
|
|
|
|
Target := valueAsString(iniFile.Section(""), "target", "all") |
|
|
|
|
if Target != "" { |
|
|
|
|
cfg.Target = strings.Split(Target, " ") |
|
|
|
|
cfg.Target = util.SplitString(Target) |
|
|
|
|
} |
|
|
|
|
Env = valueAsString(iniFile.Section(""), "app_mode", "development") |
|
|
|
|
cfg.Env = Env |
|
|
|
@ -1409,6 +1409,18 @@ func (s *DynamicSection) Key(k string) *ini.Key { |
|
|
|
|
return key |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (s *DynamicSection) KeysHash() map[string]string { |
|
|
|
|
hash := s.section.KeysHash() |
|
|
|
|
for k := range hash { |
|
|
|
|
envKey := EnvKey(s.section.Name(), k) |
|
|
|
|
envValue := os.Getenv(envKey) |
|
|
|
|
if len(envValue) > 0 { |
|
|
|
|
hash[k] = envValue |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return hash |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// SectionWithEnvOverrides dynamically overrides keys with environment variables.
|
|
|
|
|
// As a side effect, the value of the setting key will be updated if an environment variable is present.
|
|
|
|
|
func (cfg *Cfg) SectionWithEnvOverrides(s string) *DynamicSection { |
|
|
|
|