Skip to content

Commit

Permalink
fix(config): always strip comments from json
Browse files Browse the repository at this point in the history
  • Loading branch information
JanDeDobbeleer committed Mar 12, 2024
1 parent ae806a1 commit 8e24194
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/engine/config.go
Expand Up @@ -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":
Expand Down

0 comments on commit 8e24194

Please sign in to comment.