Skip to content

Instantly share code, notes, and snippets.

@yujunz
Created February 18, 2020 01:59
Show Gist options
  • Save yujunz/0104dc57f2cbcd64edaae4bd9f5d28f4 to your computer and use it in GitHub Desktop.
Save yujunz/0104dc57f2cbcd64edaae4bd9f5d28f4 to your computer and use it in GitHub Desktop.
bazel multiple version
#!/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