File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -5,17 +5,20 @@ import (
55 "path/filepath"
66 "strings"
77 "syscall"
8+
9+ "github.com/ActiveState/cli/cmd/state-exec/internal/logr"
810)
911
1012func Command (name string , arg ... string ) * exec.Cmd {
1113 cmd := exec .Command (name , arg ... )
1214
1315 exeName := filepath .Base (strings .ToLower (name ))
14- if exeName == "cmd" || strings .HasSuffix (exeName , ".bat" ) {
16+ if exeName == "cmd" || strings .HasSuffix (exeName , ".bat" ) || strings . HasSuffix ( exeName , ".cmd" ) {
1517 // Go currently does not escape arguments properly on Windows, it account for spaces and tab characters, but not
1618 // other characters that need escaping such as `<` and `>`.
1719 // This can be dropped once we update to a Go version that fixes this bug: https://github.com/golang/go/issues/68313
1820 cmd .SysProcAttr = & syscall.SysProcAttr {CmdLine : makeCmdLine (cmd .Args )}
21+ logr .Debug ("processed command line: %s" , cmd .SysProcAttr .CmdLine )
1922 }
2023
2124 return cmd
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ func Command(name string, arg ...string) *exec.Cmd {
2323 cmd := exec .Command (name , arg ... )
2424
2525 exeName := filepath .Base (strings .ToLower (name ))
26- if exeName == "cmd" || strings .HasSuffix (exeName , ".bat" ) {
26+ if exeName == "cmd" || strings .HasSuffix (exeName , ".bat" ) || strings . HasSuffix ( exeName , ".cmd" ) {
2727 // Go currently does not escape arguments properly on Windows, it account for spaces and tab characters, but not
2828 // other characters that need escaping such as `<` and `>`.
2929 // This can be dropped once we update to a Go version that fixes this bug: https://github.com/golang/go/issues/68313
You can’t perform that action at this time.
0 commit comments