Prevent "::" in PATH on multiple lunch
Running lunch multiple times results in inserting "::" each time.
"::" is an empty path element, which is treated as a current directory.
Change-Id: I770f4c1f40224ea91fd7989b0ea47d3cd081c24f
diff --git a/envsetup.sh b/envsetup.sh
index a845a18..a9417b8 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -131,12 +131,11 @@
export PATH=$PATH$ANDROID_BUILD_PATHS
unset ANDROID_JAVA_TOOLCHAIN
+ unset ANDROID_PRE_BUILD_PATHS
if [ -n "$JAVA_HOME" ]; then
export ANDROID_JAVA_TOOLCHAIN=$JAVA_HOME/bin
- fi
- export ANDROID_PRE_BUILD_PATHS=$ANDROID_JAVA_TOOLCHAIN
- if [ -n "$ANDROID_PRE_BUILD_PATHS" ]; then
- export PATH=$ANDROID_PRE_BUILD_PATHS:$PATH
+ export ANDROID_PRE_BUILD_PATHS=$ANDROID_JAVA_TOOLCHAIN:
+ export PATH=$ANDROID_PRE_BUILD_PATHS$PATH
fi
unset ANDROID_PRODUCT_OUT