switch to whichOut var for executable check
This commit is contained in:
parent
c0fb972b5f
commit
8390e16616
1 changed files with 3 additions and 5 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue