Merge "envsetup.sh: fix adb tab completion" am: 1ef63b944e

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

Change-Id: I9324867e6b23d6288150ac045bcfb724a381de08
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot 2022-05-05 09:07:17 +00:00 committed by Automerger Merge Worker
commit d436fa704b

View file

@ -395,7 +395,7 @@ function addcompletions()
fi fi
local completion_files=( local completion_files=(
system/core/adb/adb.bash packages/modules/adb/adb.bash
system/core/fastboot/fastboot.bash system/core/fastboot/fastboot.bash
tools/asuite/asuite.sh tools/asuite/asuite.sh
) )
@ -404,7 +404,9 @@ function addcompletions()
# ENVSETUP_NO_COMPLETION=adb # -> disable adb completion # ENVSETUP_NO_COMPLETION=adb # -> disable adb completion
# ENVSETUP_NO_COMPLETION=adb:bit # -> disable adb and bit completion # ENVSETUP_NO_COMPLETION=adb:bit # -> disable adb and bit completion
for f in ${completion_files[*]}; do for f in ${completion_files[*]}; do
if [ -f "$f" ] && should_add_completion "$f"; then if [ ! -f "$f" ]; then
echo "Warning: completion file $f not found"
elif should_add_completion "$f"; then
. $f . $f
fi fi
done done