Fixed command runner calls with shell
parent
fd92101159
commit
232e617844
|
@ -8,7 +8,7 @@ import (
|
||||||
|
|
||||||
// ParseCommand parses the command taking in account if the current
|
// ParseCommand parses the command taking in account if the current
|
||||||
// instance uses a shell to run the commands or just calls the binary
|
// instance uses a shell to run the commands or just calls the binary
|
||||||
// directyly.
|
// directly.
|
||||||
func ParseCommand(s *settings.Settings, raw string) ([]string, error) {
|
func ParseCommand(s *settings.Settings, raw string) ([]string, error) {
|
||||||
var command []string
|
var command []string
|
||||||
|
|
||||||
|
@ -26,7 +26,19 @@ func ParseCommand(s *settings.Settings, raw string) ([]string, error) {
|
||||||
command = append(command, cmd)
|
command = append(command, cmd)
|
||||||
command = append(command, args...)
|
command = append(command, args...)
|
||||||
} else {
|
} else {
|
||||||
command = append(s.Shell, raw) //nolint:gocritic
|
cmd, args, err := SplitCommandAndArgs(s.Shell[0])
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = exec.LookPath(cmd)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
command = append(command, cmd)
|
||||||
|
command = append(command, args...)
|
||||||
|
command = append(command, raw)
|
||||||
}
|
}
|
||||||
|
|
||||||
return command, nil
|
return command, nil
|
||||||
|
|
Loading…
Reference in New Issue