biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / by-name / gi / gitlab-runner / fix-shell-path.patch
blobb70b95e7be0b9c5cdd6a54d44cd0f6301caf6724
1 diff --git a/shells/bash.go b/shells/bash.go
2 index 18d608445..f158ffc0b 100644
3 --- a/shells/bash.go
4 +++ b/shells/bash.go
5 @@ -3,6 +3,7 @@ package shells
6 import (
7 "bytes"
8 "fmt"
9 + "os/exec"
10 "path"
11 "runtime"
12 "strconv"
13 @@ -307,7 +308,11 @@ func (b *BashShell) GetConfiguration(info common.ShellScriptInfo) (*common.Shell
15 script.Command = "su"
16 if runtime.GOOS == OSLinux {
17 - script.Arguments = []string{"-s", "/bin/" + b.Shell, info.User, "-c", script.CmdLine}
18 + shellPath, err := exec.LookPath(b.Shell)
19 + if err != nil {
20 + shellPath = "/bin/" + b.Shell
21 + }
22 + script.Arguments = []string{"-s", shellPath, info.User, "-c", script.CmdLine}
23 } else {
24 script.Arguments = []string{info.User, "-c", script.CmdLine}