summaryrefslogtreecommitdiffstats
path: root/pkg/commands/os.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2018-08-18 20:14:44 +1000
committerJesse Duffield <jessedduffield@gmail.com>2018-08-18 20:14:44 +1000
commit08666889f41aaf1f5295ef2fd4dba1465f9eed3a (patch)
tree572527759c19d08f0407f5052907a85d29ec574f /pkg/commands/os.go
parent01743755622509c93cbaa0358f8814acd59b00f6 (diff)
improve remove file logic
Diffstat (limited to 'pkg/commands/os.go')
-rw-r--r--pkg/commands/os.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/commands/os.go b/pkg/commands/os.go
index 32514a419..b72585e44 100644
--- a/pkg/commands/os.go
+++ b/pkg/commands/os.go
@@ -167,3 +167,10 @@ func (c *OSCommand) Quote(message string) string {
message = strings.Replace(message, "`", "\\`", -1)
return c.Platform.escapedQuote + message + c.Platform.escapedQuote
}
+
+// Unquote removes wrapping quotations marks if they are present
+// this is needed for removing quotes from staged filenames with spaces
+func (c *OSCommand) Unquote(message string) string {
+ message = strings.Replace(message, `"`, "", -1)
+ return message
+}