From ff64777bc6eef6819e4eee42e55371e3f46043fd Mon Sep 17 00:00:00 2001 From: andig Date: Fri, 9 Jun 2023 17:45:25 +0200 Subject: [PATCH] chore: prevent toml double quotes --- packaging/toml.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packaging/toml.go b/packaging/toml.go index 7d85970947..0b1e19c93e 100644 --- a/packaging/toml.go +++ b/packaging/toml.go @@ -36,7 +36,12 @@ func process(filepath string) error { continue } - fmt.Fprintf(pre, "%s = \"%s\"\n", key, val) + quote := `"` + if strings.Contains(val, quote) { + quote = `'` + } + + fmt.Fprintf(pre, "%s = %s%s%s\n", key, quote, val, quote) } }