Skip to content

Commit d9eb644

Browse files
committed
[CI-17118]: Add support run commands in dependencies
1 parent 4742fae commit d9eb644

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

plugin/harness/execer.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,12 @@ func (e *Execer) installChocoDeps(ctx context.Context, deps []string) {
237237
}
238238

239239
func (e *Execer) installRunScripts(ctx context.Context, cmds []string) {
240+
shell := "bash"
241+
if _, err := exec.LookPath("bash"); err != nil {
242+
shell = "sh"
243+
}
240244
for _, item := range cmds {
241-
cmd := exec.Command(item)
245+
cmd := exec.Command(shell, item)
242246
if err := runCmds(ctx, []*exec.Cmd{cmd}, e.Environ, e.Workdir,
243247
e.Stdout, e.Stderr); err != nil {
244248
slog.Error("run command failed", slog.String("command", item), "error", err)

0 commit comments

Comments
 (0)