From e7e69c49d5a43e9905dff40ed97379ae2b0b74a2 Mon Sep 17 00:00:00 2001 From: Morten Mjelva Date: Thu, 4 Jan 2024 12:45:52 +0100 Subject: [PATCH] Update gazelle.bash.in (#1710) --- internal/gazelle.bash.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/gazelle.bash.in b/internal/gazelle.bash.in index 18cd93bb5..8380c486a 100644 --- a/internal/gazelle.bash.in +++ b/internal/gazelle.bash.in @@ -41,12 +41,14 @@ REPO_CONFIG_PATH=@@REPO_CONFIG_PATH@@ # use the SDK used by the workspace in case the Go SDK is not installed # on the host system or is a different version. function set_goroot { - local gotool=$(rlocation "$GOTOOL") + local gotool + gotool=$(rlocation "$GOTOOL") if [ -z "$gotool" ]; then echo "$0: warning: could not locate GOROOT used by rules_go" >&2 return fi - export GOROOT=$(cd "$(dirname "$gotool")/.."; pwd) + GOROOT=$(cd "$(dirname "$gotool")/.."; pwd) + export GOROOT if type cygpath >/dev/null 2>&1; then # On Windows, convert the path to something usable outside of bash. GOROOT=$(cygpath -w "$GOROOT")