diff --git a/linux/run.go b/linux/run.go index ec90af2..8009d16 100644 --- a/linux/run.go +++ b/linux/run.go @@ -30,7 +30,7 @@ func NewCommand(options CommandOptions) (*LinuxCommand, error) { func (cmd *LinuxCommand) Run() error { command := exec.Command(cmd.Options.Shell, "-c", cmd.Options.Command) - command.Path = cmd.Options.Cwd + command.Dir = cmd.Options.Cwd command.Args = append(command.Args, cmd.Options.Args...) // Loop through env to format and add them to the command. diff --git a/linux/utils.go b/linux/utils.go index 7bc4bc9..ba6a1d5 100644 --- a/linux/utils.go +++ b/linux/utils.go @@ -16,9 +16,10 @@ func (cmd *LinuxCommand) isCommandExecutable(command string) (bool, error) { } if err := unix.Access(command, unix.X_OK); err != nil { - if !errors.Is(err, unix.EACCES) { + if err == unix.EACCES { return false, nil } else { + fmt.Println(err) return false, err } } diff --git a/main.go b/main.go index 31c1b00..e5b9d97 100644 --- a/main.go +++ b/main.go @@ -1,4 +1,4 @@ -package shell +package main import ( "bytes"