Skip to content

Commit

Permalink
Use %q instead of literal quotes
Browse files Browse the repository at this point in the history
Co-authored-by: Nate Finch <nate.finch@gmail.com>
  • Loading branch information
shouldsee and natefinch committed May 20, 2020
1 parent e672dba commit 2b62f93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sh/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func run(env map[string]string, stdout, stderr io.Writer, cmd string, args ...st

var quoted []string
for i := range args {
quoted=append(quoted,fmt.Sprintf("\"%s\"",args[i]));
quoted=append(quoted,fmt.Sprintf("%q",args[i]));
}
log.Println("exec:", cmd, strings.Join(quoted, " "))
err = c.Run()
Expand Down

0 comments on commit 2b62f93

Please sign in to comment.