From 8390e16616e8e3cbbaf3e8b17cc2ef6d62f817a8 Mon Sep 17 00:00:00 2001 From: Shane C Date: Wed, 10 Jul 2024 20:22:32 -0400 Subject: [PATCH] switch to whichOut var for executable check --- linux/utils.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/linux/utils.go b/linux/utils.go index ca76814..21d38fb 100644 --- a/linux/utils.go +++ b/linux/utils.go @@ -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 {