From 942735b7266c3f74cace19a4a83f7014ea0f53cd Mon Sep 17 00:00:00 2001 From: Shane C Date: Thu, 4 Jul 2024 17:27:41 -0400 Subject: [PATCH] fix permissions error, fix cwd path --- linux/run.go | 2 +- linux/utils.go | 3 ++- main.go | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) 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"