Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix two shellcheck warnings in gazelle.bash.in #1710

Merged
merged 1 commit into from
Jan 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions internal/gazelle.bash.in
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down