Skip to content

Commit

Permalink
Fix binary path name on windows test
Browse files Browse the repository at this point in the history
  • Loading branch information
danawoodman committed Feb 27, 2024
1 parent eeef491 commit 80f8104
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"
"syscall"
"testing"
"time"
Expand Down Expand Up @@ -206,7 +207,13 @@ func command(t *testing.T, binDir string, stdout, stderr io.Writer, conf conf) *
}
parts = append(parts, conf.pattern)
parts = append(parts, "--", "echo", "hello")
cmd := exec.Command(filepath.Join(binDir, "cng"), parts...)
var execName string
if runtime.GOOS == "windows" {
execName = "cng.exe"
} else {
execName = "cng"
}
cmd := exec.Command(filepath.Join(binDir, execName), parts...)
cmd.Stdout = stdout
cmd.Stderr = stderr
return cmd
Expand Down

0 comments on commit 80f8104

Please sign in to comment.