Skip to content

Commit

Permalink
fix: rm single quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrocode authored Jun 18, 2024
1 parent 207d3ac commit d389a81
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,14 @@ resource "null_resource" "default" {
) : "",
try(length(each.value["note"]["text"]), 0) > 0 || length(var.note_suffix) > 0 ? format(
"--note Text=\"%s%s\",UpdatedBy=\"%s\"",
# escape commas and escape double quotations
replace(replace(each.value["note"]["text"], ",", "\\,"), "\"", "'"),
replace(replace(replace(each.value["note"]["text"],
# TODO: escape single quotes, for now remove them
"'", ""),
# escape commas
",", "\\,"),
# escape double quotations
"\"", "'"
),
var.note_suffix,
coalesce(each.value["note"]["updated_by"], var.default_note_updated_by)
) : "",
Expand Down

0 comments on commit d389a81

Please sign in to comment.