Skip to content

Commit

Permalink
fix sdk detection
Browse files Browse the repository at this point in the history
  • Loading branch information
wysaid committed Jan 16, 2023
1 parent 0328b4b commit 1803aae
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions vscode_tasks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,16 @@ function buildProject() {
}

if [[ ! -f "local.properties" ]]; then
if [[ -n "$ANDROID_SDK_HOME" ]]; then
echo "sdk.dir=$ANDROID_SDK_HOME" >>local.properties
if [[ -n "$ANDROID_HOME" ]]; then
echo "sdk.dir=$ANDROID_HOME" >>local.properties
elif [[ -n "$ANDROID_SDK_ROOT" ]]; then
echo "sdk.dir=$ANDROID_SDK_ROOT" >>local.properties
elif [[ -n "$ANDROID_SDK_HOME" ]]; then
if [[ -d "$ANDROID_SDK_HOME/platform-tools" ]]; then
echo "sdk.dir=$ANDROID_SDK_HOME" >>local.properties
elif [[ -d "$ANDROID_SDK_HOME/../platform-tools" ]]; then
echo "sdk.dir=$(realpath $ANDROID_SDK_HOME/../platform-tools)" >>local.properties
fi
elif [[ -n "$ANDROID_SDK" ]]; then
echo "sdk.dir=$ANDROID_SDK" >>local.properties
else
Expand Down

0 comments on commit 1803aae

Please sign in to comment.