switch to whichOut var for executable check

This commit is contained in:
Shane C 2024-07-10 20:22:32 -04:00
parent c0fb972b5f
commit 8390e16616
Signed by: shane
GPG key ID: E46B5FEA35B22FF9

View file

@ -27,13 +27,11 @@ func (cmd *LinuxCommand) isCommandExecutable(command string) (bool, error) {
}
}
if len(whichOut) > 0 {
command = whichOut
if len(whichOut) == 0 {
return false, nil
}
fmt.Println("cmd: ", command)
if err := unix.Access(command, unix.X_OK); err != nil {
if err := unix.Access(whichOut, unix.X_OK); err != nil {
if err == unix.EACCES {
return false, nil
} else {