From cb5c73fd9e7abd4576271707c5f07d1c4b284f6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Kongstad?= Date: Wed, 4 May 2022 14:08:12 +0000 Subject: [PATCH] envsetup.sh: fix adb tab completion The adb module has been moved from system/core to packages/modules/adb. Update the path to the adb tab completion script accordingly. Also teach envsetup.sh to complain if completion files are not found. Test: manual: adb tab completion works Test: source build/envsetup.sh && declare -F _adb Change-Id: I7d6fda3813b95e64de7b1953675f66659e750c31 --- envsetup.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/envsetup.sh b/envsetup.sh index e7b85382d0..b49bb8a21e 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -395,7 +395,7 @@ function addcompletions() fi local completion_files=( - system/core/adb/adb.bash + packages/modules/adb/adb.bash system/core/fastboot/fastboot.bash tools/asuite/asuite.sh ) @@ -404,7 +404,9 @@ function addcompletions() # ENVSETUP_NO_COMPLETION=adb # -> disable adb completion # ENVSETUP_NO_COMPLETION=adb:bit # -> disable adb and bit completion 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 fi done