Created
February 18, 2020 01:59
-
-
Save yujunz/0104dc57f2cbcd64edaae4bd9f5d28f4 to your computer and use it in GitHub Desktop.
bazel multiple version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
VERSION=1.0.1 | |
BASE=${HOME}/.bazel/${VERSION} | |
BAZEL=${BASE}/bin/bazel | |
if ! [ -f "$BAZEL" ]; then | |
GIT_ROOT=$(git rev-parse --show-toplevel) | |
OS=$(uname | tr '[:upper:]' '[:lower:]') | |
ARCH=$(uname -m) | |
INSTALLER=bazel-${VERSION}-installer-${OS}-${ARCH}.sh | |
curl -L https://github.com/bazelbuild/bazel/releases/download/${VERSION}/${INSTALLER} > /tmp/${INSTALLER} | |
bash "/tmp/${INSTALLER}" --bin=$NUCLEUS/bin --base=${BASE} | |
fi | |
exec $BAZEL "$@" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment