mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
fix(config): always strip comments from json
This commit is contained in:
parent
ae806a1942
commit
8e2419452c
|
@ -143,13 +143,11 @@ func loadConfig(env platform.Environment) *Config {
|
|||
cfg.Format = YAML
|
||||
err = yaml.Unmarshal(data, &cfg)
|
||||
case "jsonc", "json":
|
||||
if cfg.Format == "jsonc" {
|
||||
str := jsonutil.StripComments(string(data))
|
||||
data = []byte(str)
|
||||
}
|
||||
|
||||
cfg.Format = JSON
|
||||
|
||||
str := jsonutil.StripComments(string(data))
|
||||
data = []byte(str)
|
||||
|
||||
decoder := json.NewDecoder(bytes.NewReader(data))
|
||||
err = decoder.Decode(&cfg)
|
||||
case "toml", "tml":
|
||||
|
|
Loading…
Reference in a new issue