From 80dcfc362bd7ae01e4610682a4f3be565143bea3 Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Mon, 22 Nov 2021 22:49:23 -0500 Subject: [PATCH] fix: allow non absolute paths to be executed this is a regression introduced in 06272778f85dad04e0e7abffc78a5b9b0cebd067 --- shell.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/shell.go b/shell.go index 06854fa..11f1f2f 100644 --- a/shell.go +++ b/shell.go @@ -166,6 +166,13 @@ func execCommand(cmd string) error { // custom lookpath function so we know if a command is found *and* has execute permission func lookpath(file string) error { + skip := []string{"./", "/", "../", "~/"} + for _, s := range skip { + if strings.HasPrefix(file, s) { + err := findExecutable(file) + return err + } + } for _, dir := range filepath.SplitList(os.Getenv("PATH")) { path := filepath.Join(dir, file) err := findExecutable(path)