Skip to content

Commit

Permalink
Use powershell on windows instead of bash
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherHX committed Apr 29, 2023
1 parent 35f5f97 commit 62e165f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/runner/step_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package runner
import (
"context"
"fmt"
"runtime"
"strings"

"github.com/kballard/go-shellquote"
Expand Down Expand Up @@ -167,6 +168,12 @@ func (sr *stepRun) setupShell(ctx context.Context) {
step.Shell = "sh"
}
}
// Don't use bash on windows by default, if not using a docker container
if step.Shell == "" && runtime.GOOS == "windows" {
if _, ok := rc.JobContainer.(*container.HostEnvironment); ok {
step.Shell = "powershell"
}
}
}

func (sr *stepRun) setupWorkingDirectory(ctx context.Context) {
Expand Down

0 comments on commit 62e165f

Please sign in to comment.