Skip to content

Commit 8c6e143

Browse files
committed
fixing windows
Signed-off-by: James Alseth <[email protected]>
1 parent eed5ee8 commit 8c6e143

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

plugin/plugin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ func parseCommand(command string, extraArgs []string) (string, []string, error)
203203
}
204204

205205
func commandHasPath(command string) bool {
206-
return filepath.IsAbs(command) || strings.HasPrefix(command, "../") || strings.HasPrefix(command, "./")
206+
return strings.Contains(command, string(os.PathSeparator))
207207
}
208208

209209
func parseWindowsCommand(command string, extraArgs []string) (string, []string, error) {

plugin/plugin_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ func TestParseCommand(t *testing.T) {
3434
},
3535
{
3636
desc: "full path with space in command",
37-
cmd: "/Users/user/Library/Application Support/.conftest/plugins/kubectl/kubectl.sh some-resource",
38-
wantExec: "/Users/user/Library/Application Support/.conftest/plugins/kubectl/kubectl.sh",
37+
cmd: filepath.ToSlash("/Users/user/Library/Application Support/.conftest/plugins/kubectl/kubectl.sh some-resource"),
38+
wantExec: filepath.ToSlash("/Users/user/Library/Application Support/.conftest/plugins/kubectl/kubectl.sh"),
3939
wantArgs: []string{"some-resource"},
4040
},
4141
{

0 commit comments

Comments
 (0)