mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-28 20:39:40 -08:00
chore: do not load config options more than once
do not set options for the configuration when it already has been set this allows several prompt engines being created in a single runtime
This commit is contained in:
parent
4b880fec49
commit
3559254292
|
@ -113,11 +113,14 @@ func loadConfig(env platform.Environment) *Config {
|
|||
config.AddDriver(yaml.Driver)
|
||||
config.AddDriver(json.Driver)
|
||||
config.AddDriver(toml.Driver)
|
||||
config.WithOptions(func(opt *config.Options) {
|
||||
opt.DecoderConfig = &mapstructure.DecoderConfig{
|
||||
TagName: "json",
|
||||
}
|
||||
})
|
||||
|
||||
if config.Default().IsEmpty() {
|
||||
config.WithOptions(func(opt *config.Options) {
|
||||
opt.DecoderConfig = &mapstructure.DecoderConfig{
|
||||
TagName: "json",
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
err := config.LoadFiles(configFile)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue