From 1433fb357b18750a6330a4b25d4334b72311626b Mon Sep 17 00:00:00 2001 From: Usta Shrestha Date: Fri, 13 May 2022 14:49:40 -0400 Subject: [PATCH] Allow sourcing envsetup from anywhere Bug: 232555676 Test: cd build && source envsetup.sh Change-Id: I8491628406e494f31589249d1cc851b672dd7cae --- envsetup.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/envsetup.sh b/envsetup.sh index b079d4199b..f141ff5c19 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -403,7 +403,9 @@ function addcompletions() # e.g. # ENVSETUP_NO_COMPLETION=adb # -> disable adb completion # ENVSETUP_NO_COMPLETION=adb:bit # -> disable adb and bit completion + local T=$(gettop) for f in ${completion_files[*]}; do + f="$T/$f" if [ ! -f "$f" ]; then echo "Warning: completion file $f not found" elif should_add_completion "$f"; then