Skip to content

Commit

Permalink
fix: invalid character 'P' in string escape code when --output
Browse files Browse the repository at this point in the history
on windows this error occured when exporting via `enve --output json`
or `enve --output xml`
  • Loading branch information
joseluisq committed Feb 27, 2022
1 parent d1d29cc commit 8920456
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ func parseJSONFromEnviron() (jsonu Environment, err error) {
}
val := strings.ReplaceAll(pairs[1], "\"", "\\\"")
val = strings.ReplaceAll(val, "\n", "\\n")
val = strings.ReplaceAll(val, "\\", "\\\\")
val = strings.ReplaceAll(val, "\r", "\\r")
jsonstr += fmt.Sprintf("{\"name\":\"%s\",\"value\":\"%s\"}%s", pairs[0], val, sep)
}
Expand Down

0 comments on commit 8920456

Please sign in to comment.