mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-03-05 15:15:49 +02:00
fix: escape quote character on Linux
Co-authored-by: Dawid Dziurla <dawidd0811@gmail.com> Closes #269
This commit is contained in:
parent
5a0431bb62
commit
717913e64c
@ -140,6 +140,13 @@ func (c *OSCommand) PrepareSubProcess(cmdName string, commandArgs ...string) *ex
|
||||
// Quote wraps a message in platform-specific quotation marks
|
||||
func (c *OSCommand) Quote(message string) string {
|
||||
message = strings.Replace(message, "`", "\\`", -1)
|
||||
if c.Platform.os == "linux" {
|
||||
if strings.ContainsRune(message, '\'') {
|
||||
c.Platform.escapedQuote = `"`
|
||||
} else {
|
||||
c.Platform.escapedQuote = `'`
|
||||
}
|
||||
}
|
||||
return c.Platform.escapedQuote + message + c.Platform.escapedQuote
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user