Wrap filenames in quotes only for Windows CMD (#1371)

This commit is contained in:
Joe Lim authored and GitHub committed 2023-08-07 17:56:14 +10:00
1 parent b3ac207c34
commit 1c52e3ad68
1 file changed
+5 -1
+5 -1
View File
@@ -180,5 +180,9 @@ func errCrossDevice(err error) bool {
}
func quoteString(s string) string {
return fmt.Sprintf(`"%s"`, s)
// Windows CMD requires special handling to deal with quoted arguments
if strings.ToLower(gOpts.shell) == "cmd" {
return fmt.Sprintf(`"%s"`, s)
}
return s
}