Skip to content

Commit

Permalink
Wrap filenames in quotes only for Windows CMD (#1371)
Browse files Browse the repository at this point in the history
  • Loading branch information
joelim-work authored Aug 7, 2023
1 parent b3ac207 commit 1c52e3a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion os_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 1c52e3a

Please sign in to comment.