Merge "Improve bazel() warning in envsetup.sh." am: c137b8520b am: e0b4775fed

Original change: https://android-review.googlesource.com/c/platform/build/+/1732933

Change-Id: I9fbbe19b672c4bd0f514040fc6d49b82aefaf784
This commit is contained in:
Jingwen Chen
2021-06-10 11:06:02 +00:00
committed by Automerger Merge Worker

View File

@@ -331,15 +331,15 @@ function setpaths()
function bazel()
{
local T="$(gettop)"
if [ ! "$T" ]; then
echo "Couldn't locate the top of the tree. Try setting TOP."
return
if which bazel &>/dev/null; then
>&2 echo "NOTE: bazel() function sourced from Android's envsetup.sh is being used instead of $(which bazel)"
>&2 echo
fi
if which bazel &>/dev/null; then
>&2 echo "NOTE: bazel() function sourced from envsetup.sh is being used instead of $(which bazel)"
>&2 echo
local T="$(gettop)"
if [ ! "$T" ]; then
>&2 echo "Couldn't locate the top of the Android tree. Try setting TOP. This bazel() function cannot be used outside of the AOSP directory."
return
fi
"$T/tools/bazel" "$@"