From 1c52e3ad682a3c3f6154f2de60b63a11b6871910 Mon Sep 17 00:00:00 2001 From: Joe Lim <50560759+joelim-work@users.noreply.github.com> Date: Mon, 7 Aug 2023 17:56:14 +1000 Subject: [PATCH] Wrap filenames in quotes only for Windows CMD (#1371) --- os_windows.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/os_windows.go b/os_windows.go index 47968868..9e579c8e 100644 --- a/os_windows.go +++ b/os_windows.go @@ -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 }