From f627fde1866bf00057bce938f1ebdea3bbe86501 Mon Sep 17 00:00:00 2001 From: Shane C Date: Wed, 10 Jul 2024 21:45:07 -0400 Subject: [PATCH] debug --- cmd/which.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/cmd/which.go b/cmd/which.go index a06f08a..7578692 100644 --- a/cmd/which.go +++ b/cmd/which.go @@ -17,25 +17,20 @@ type BasicOptions struct { func Which(cmd string, options BasicOptions) (dir string, err error) { - fmt.Println(options.Env) - fmt.Println(options.Sources) - var sourceCommand strings.Builder for _, value := range options.Sources { sourceCommand.WriteString(fmt.Sprintf("source %s && ", value)) } - fmt.Println(cmd) - command := exec.Command("/bin/bash", "-c", "which", cmd) if options.Cwd != "" { command.Dir = options.Cwd } - //for k, v := range options.Env { - // command.Env = append(command.Env, fmt.Sprintf("%s=%s", k, v)) - //} + for k, v := range options.Env { + command.Env = append(command.Env, fmt.Sprintf("%s=%s", k, v)) + } outputBytes, err := command.Output() if err != nil { @@ -49,8 +44,6 @@ func Which(cmd string, options BasicOptions) (dir string, err error) { } } - fmt.Println(string(outputBytes)) - return strings.Trim(string(outputBytes), "\n"), nil }