Skip to content

Commit 4a116da

Browse files
committed
fix #2 "move default sdk root to home folder"
1 parent a16f46c commit 4a116da

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
### sdkmanager
1515

1616
The sdkmanager is a command line tool that allows you to view, install, update, and uninstall packages for the Android SDK. If you're using Android Studio, then you do not need to use this tool and you can instead manage your SDK packages from the IDE.
17-
The sdkmanager tool is provided in the Android SDK Tools package (25.2.3 and higher) and is located in ~/snap/androidsdk/current/tools/bin/.
17+
The sdkmanager tool is provided in the Android SDK Tools package (25.2.3 and higher) and is located in ~/AndroidSDK.
1818

1919
## Install
2020

scripts/start.sh

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,31 @@
11
#!/bin/bash
22

3-
SDK_ROOT=$HOME/AndroidSDK
3+
EXTERNAL_HOME=/home/$USER
4+
OLD_SDK_ROOT=$HOME/AndroidSDK
5+
SDK_ROOT=$EXTERNAL_HOME/AndroidSDK
46

57
export JAVA_HOME="$SNAP/usr/lib/jvm/java-8-openjdk-amd64"
68
export ANDROID_SDK_HOME="$HOME/.Android"
79
export _JAVA_OPTIONS=-Duser.home=$HOME
810

11+
if [ "$(ls -A $OLD_SDK_ROOT)" ]; then
12+
echo "The default sdk folder has been changed from $OLD_SDK_ROOT to $SDK_ROOT ."
13+
echo "The Old location of sdk root have big problems with update the androidsdk package."
14+
echo "For more information about this problem see the https://github.com/QuasarApp/sdkmanager-android/issues/2 issue."
15+
echo ""
16+
17+
if [ ! -d $SDK_ROOT ]
18+
then
19+
mkdir $SDK_ROOT
20+
fi
21+
22+
mv $OLD_SDK_ROOT $EXTERNAL_HOME
23+
ln -s $SDK_ROOT $OLD_SDK_ROOT
24+
echo "All your installed sdk files has been moved to new location."
25+
echo "If you want change a sdk location please use the --sdk_root option."
26+
27+
fi
28+
929
for var in "$@"
1030
do
1131
if [[ $var == *"--sdk_root"* ]]; then

snap/snapcraft.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: androidsdk
2-
version: '1.0.6.1'
2+
version: '1.1.0.0'
33
summary: The package contains android sdkmanager.
44
description: |
55
This is snap version of console sdk manager for Android. For more information about sdkmanager see official google documentation git@github.com:EndrII/sdkmanager-android.git.

0 commit comments

Comments
 (0)