mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-31 13:57:26 -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(yaml.Driver)
|
||||||
config.AddDriver(json.Driver)
|
config.AddDriver(json.Driver)
|
||||||
config.AddDriver(toml.Driver)
|
config.AddDriver(toml.Driver)
|
||||||
config.WithOptions(func(opt *config.Options) {
|
|
||||||
opt.DecoderConfig = &mapstructure.DecoderConfig{
|
if config.Default().IsEmpty() {
|
||||||
TagName: "json",
|
config.WithOptions(func(opt *config.Options) {
|
||||||
}
|
opt.DecoderConfig = &mapstructure.DecoderConfig{
|
||||||
})
|
TagName: "json",
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
err := config.LoadFiles(configFile)
|
err := config.LoadFiles(configFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue