blob: 34b4a7ffc1f2030dfdc9290443ec3ce4cf654bd5 [file] [log] [blame]
#!/bin/bash
# Copyright 2022 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
run_bazel() {
local bazel="${REPO_ROOT}/tools/bazel"
if [[ ! -x "${bazel}" ]]; then
>&2 echo -n "␛[31;1m"
>&2 echo "Bazel does not exist at ${bazel}. "
>&2 echo -n "Please run the boostrap script [scripts/bootstrap.sh] and try again:"
>&2 echo "␛[0m"
exit 1
fi
if [[ -z "$OUTPUT_BASE" ]]; then
"${bazel}" "$@"
else
"${bazel}" --output_base="${OUTPUT_BASE}" "$@"
fi
}