1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-02-09 13:47:11 +02:00

Use strings.Replace instead of regexp

This commit is contained in:
Tommy Nguyen 2018-08-16 17:04:39 -04:00
parent a7755ab184
commit 52033b32f7

View File

@ -5,7 +5,7 @@ import (
"os"
"os/exec"
"runtime"
"regexp"
"strings"
"github.com/davecgh/go-spew/spew"
@ -171,7 +171,6 @@ func (c *OSCommand) PrepareSubProcess(cmdName string, commandArgs ...string) (*e
// Quote wraps a message in platform-specific quotation marks
func (c *OSCommand) Quote(message string) string {
r := regexp.MustCompile("`")
message = r.ReplaceAllString(message, "\\`")
message = strings.Replace(message, "`", "\\`", -1)
return c.Platform.escapedQuote + message + c.Platform.escapedQuote
}