diff options
Diffstat (limited to 'pkg/commands')
-rw-r--r-- | pkg/commands/oscommands/os.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pkg/commands/oscommands/os.go b/pkg/commands/oscommands/os.go index d560f6d57..b6181364f 100644 --- a/pkg/commands/oscommands/os.go +++ b/pkg/commands/oscommands/os.go @@ -202,7 +202,13 @@ func (c *OSCommand) ShellCommandFromString(commandStr string) *exec.Cmd { quotedCommand := "" // Windows does not seem to like quotes around the command if c.Platform.OS == "windows" { - quotedCommand = strings.Replace(commandStr, "&", "^&", -1) + quotedCommand = commandStr + quotedCommand = strings.Replace(quotedCommand, "^", "^^", -1) + quotedCommand = strings.Replace(quotedCommand, "&", "^&", -1) + quotedCommand = strings.Replace(quotedCommand, "|", "^|", -1) + quotedCommand = strings.Replace(quotedCommand, "<", "^<", -1) + quotedCommand = strings.Replace(quotedCommand, ">", "^>", -1) + quotedCommand = strings.Replace(quotedCommand, "%", "^%", -1) } else { quotedCommand = c.Quote(commandStr) } |