mirror of
https://github.com/harness/drone.git
synced 2025-05-07 00:19:47 +08:00
Merge pull request #1772 from benschumacher/bugfix/command
Correct escaping of commands in YAML
This commit is contained in:
commit
e932bc8871
@ -40,7 +40,7 @@ func toScript(commands []string) string {
|
|||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
for _, command := range commands {
|
for _, command := range commands {
|
||||||
escaped := fmt.Sprintf("%q", command)
|
escaped := fmt.Sprintf("%q", command)
|
||||||
escaped = strings.Replace(command, "$", `$\`, -1)
|
escaped = strings.Replace(escaped, "$", `\$`, -1)
|
||||||
buf.WriteString(fmt.Sprintf(
|
buf.WriteString(fmt.Sprintf(
|
||||||
traceScript,
|
traceScript,
|
||||||
escaped,
|
escaped,
|
||||||
|
Loading…
Reference in New Issue
Block a user