fix permissions error, fix cwd path

This commit is contained in:
Shane C 2024-07-04 17:27:41 -04:00
parent 368b99ecfa
commit 942735b726
Signed by: shane
GPG key ID: E46B5FEA35B22FF9
3 changed files with 4 additions and 3 deletions

View file

@ -30,7 +30,7 @@ func NewCommand(options CommandOptions) (*LinuxCommand, error) {
func (cmd *LinuxCommand) Run() error { func (cmd *LinuxCommand) Run() error {
command := exec.Command(cmd.Options.Shell, "-c", cmd.Options.Command) 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...) command.Args = append(command.Args, cmd.Options.Args...)
// Loop through env to format and add them to the command. // Loop through env to format and add them to the command.

View file

@ -16,9 +16,10 @@ func (cmd *LinuxCommand) isCommandExecutable(command string) (bool, error) {
} }
if err := unix.Access(command, unix.X_OK); err != nil { if err := unix.Access(command, unix.X_OK); err != nil {
if !errors.Is(err, unix.EACCES) { if err == unix.EACCES {
return false, nil return false, nil
} else { } else {
fmt.Println(err)
return false, err return false, err
} }
} }

View file

@ -1,4 +1,4 @@
package shell package main
import ( import (
"bytes" "bytes"