Use bazelisk as first choice for mvn.sh mvn.sh should prefer bazelisk as first choice for running bazel, falling back to the current bazel binary. Change-Id: I5196f25d3d328f507022e589a0feeb7a67ec2bf4
diff --git a/tools/maven/mvn.sh b/tools/maven/mvn.sh index 6fd6341..9b05b6f 100755 --- a/tools/maven/mvn.sh +++ b/tools/maven/mvn.sh
@@ -49,8 +49,14 @@ set -o xtrace fi -bazel build //tools/maven:gen_${command} || \ - { echo "bazel failed to build gen_${command}. Use VERBOSE=1 for more info" ; exit 1 ; } +if [[ `which bazelisk` ]]; then + BAZEL_CMD=bazelisk +else + BAZEL_CMD=bazel +fi + +${BAZEL_CMD} build //tools/maven:gen_${command} || \ + { echo "${BAZEL_CMD} failed to build gen_${command}. Use VERBOSE=1 for more info" ; exit 1 ; } export OUTPUT_BASE=`bazel info output_base` ./bazel-bin/tools/maven/${command}.sh