zsh completion: Support BUILD.bazel files
This script seems to predate support for `BUILD.bazel` files, and didn't get updated when the bash completion did.
Closes #7367.
PiperOrigin-RevId: 234656608
diff --git a/scripts/zsh_completion/_bazel b/scripts/zsh_completion/_bazel
index 5958830..b247383 100644
--- a/scripts/zsh_completion/_bazel
+++ b/scripts/zsh_completion/_bazel
@@ -186,7 +186,7 @@
fi
paths=(${^package_roots}/${pfx}*(/))
for p in ${paths[*]}; do
- if [[ -f ${p}/BUILD ]]; then
+ if [[ -f ${p}/BUILD || -f ${p}/BUILD.bazel ]]; then
final_paths+=(${p##*/}:)
fi
final_paths+=(${p##*/}/)
@@ -207,7 +207,7 @@
if [[ "${(e)PREFIX}" != *:* ]]; then
# There is no : in the prefix, completion can be either
# a package or a target, if the cwd is a package itself.
- if [[ -f $PWD/BUILD ]]; then
+ if [[ -f $PWD/BUILD || -f $PWD/BUILD.bazel ]]; then
targets=($(_get_build_targets ""))
_description build_target expl "BUILD target"
compadd "${expl[@]}" -a targets