Skip to content

Commit

Permalink
correcly escape ldflags (therecipe/pull/1048 from @domust)
Browse files Browse the repository at this point in the history
  • Loading branch information
akiyosi committed Jul 15, 2023
1 parent c0c124a commit 7249f85
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/cmd/deploy/build_escape.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ func escapeFlags(ldFlags []string, ldFlagsCustom string) string {
ldFlags = append(ldFlags, strings.Split(ldFlagsCustom, " ")...)
}

if out := strings.Replace(strings.Join(ldFlags, "\" \""), "_DONT_ESCAPE_", " ", -1); len(out) > 0 {
return fmt.Sprintf("\"%v\"", out)
if out := strings.Replace(strings.Join(ldFlags, " "), "_DONT_ESCAPE_", " ", -1); len(out) > 0 {
return fmt.Sprintf("%q", out)
}
return ""
}

0 comments on commit 7249f85

Please sign in to comment.