aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/bazel-complete-template.bash
diff options
context:
space:
mode:
authorGravatar Ian Cottrell <iancottrell@google.com>2017-08-24 11:20:43 +0200
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2017-08-24 14:00:16 +0200
commita7c54727065b1dfff94089d9865bbe79c5085349 (patch)
tree32ba9b603b3a243a03d7d3d5810b4902334270b6 /scripts/bazel-complete-template.bash
parentefba8c2f29624da2750f7f0f75f42955600ed720 (diff)
Support BUILD.bazel in the autocomplete script
This adds support for BUILD.bazel in the bash auto completion script. Closes #3604. PiperOrigin-RevId: 166317130
Diffstat (limited to 'scripts/bazel-complete-template.bash')
-rw-r--r--scripts/bazel-complete-template.bash7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/bazel-complete-template.bash b/scripts/bazel-complete-template.bash
index 725a03f28c..cccc1acca1 100644
--- a/scripts/bazel-complete-template.bash
+++ b/scripts/bazel-complete-template.bash
@@ -229,7 +229,10 @@ _bazel__expand_rules_in_package() {
cut -f2 -d: | "grep" "^$rule_prefix")
else
for root in $(_bazel__package_path "$workspace" "$displacement"); do
- buildfile="$root/$package_name/BUILD"
+ buildfile="$root/$package_name/BUILD.bazel"
+ if [ ! -f "$buildfile" ]; then
+ buildfile="$root/$package_name/BUILD"
+ fi
if [ -f "$buildfile" ]; then
result=$(_bazel__matching_targets \
"$pattern" "$rule_prefix" <"$buildfile")
@@ -268,7 +271,7 @@ _bazel__expand_package_name() {
[[ "$dir" =~ ^(.*/)?\.[^/]*$ ]] && continue # skip dotted dir (e.g. .git)
found=1
echo "${dir#$root}/"
- if [ -f $dir/BUILD ]; then
+ if [ -f $dir/BUILD.bazel -o -f $dir/BUILD ]; then
if [ "${type}" = "label-package" ]; then
echo "${dir#$root} "
else