Skip to content

Commit

Permalink
Merge branch 'main' into v1.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bhou authored Oct 16, 2023
2 parents 3690386 + 5ba832b commit 34971e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal/command/default-command.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ func (cmd *DefaultCommand) script_ext(os string) string {
if os == "windows" {
return ".bat"
}
return ""
return ".sh"
}

func (cmd *DefaultCommand) interpolate(text string) string {
Expand Down
8 changes: 4 additions & 4 deletions internal/command/default-command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func TestConditionalScriptRender(t *testing.T) {
if runtime.GOOS == "windows" {
assert.Equal(t, "test.bat", cmd.interpolateCmd())
} else {
assert.Equal(t, "test", cmd.interpolateCmd())
assert.Equal(t, "test.sh", cmd.interpolateCmd())
}
}

Expand All @@ -191,7 +191,7 @@ func TestConditionalScriptExtensionRender(t *testing.T) {
if runtime.GOOS == "windows" {
assert.Equal(t, "test.bat", cmd.interpolateCmd())
} else {
assert.Equal(t, "test", cmd.interpolateCmd())
assert.Equal(t, "test.sh", cmd.interpolateCmd())
}
}

Expand Down Expand Up @@ -219,9 +219,9 @@ func TestInterpolate(t *testing.T) {
cmd.CmdArguments = []string{"-l", "-a", "#SCRIPT#"}

assert.Equal(t, ".bat", cmd.doInterpolate("windows", "x64", "#SCRIPT_EXT#"))
assert.Equal(t, "", cmd.doInterpolate("linux", "x64", "#SCRIPT_EXT#"))
assert.Equal(t, ".sh", cmd.doInterpolate("linux", "x64", "#SCRIPT_EXT#"))
assert.Equal(t, "test.bat", cmd.doInterpolate("windows", "x64", "#SCRIPT#"))
assert.Equal(t, "test", cmd.doInterpolate("linux", "x64", "#SCRIPT#"))
assert.Equal(t, "test.sh", cmd.doInterpolate("linux", "x64", "#SCRIPT#"))
assert.Equal(t, "/tmp/test/root/windows/x64/test.exe", cmd.doInterpolate("windows", "x64", "#CACHE#/#OS#/#ARCH#/test#EXT#"))
}

Expand Down

0 comments on commit 34971e9

Please sign in to comment.