summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xTestScripts/install-ndk.sh18
1 files changed, 16 insertions, 2 deletions
diff --git a/TestScripts/install-ndk.sh b/TestScripts/install-ndk.sh
index b202e5f6..99591794 100755
--- a/TestScripts/install-ndk.sh
+++ b/TestScripts/install-ndk.sh
@@ -37,16 +37,30 @@
if [ -z "${ANDROID_SDK_ROOT}" ]; then
echo "ERROR: ANDROID_SDK_ROOT is not set for ${USER}. Please set it."
- echo "ANDROID_SDK_ROOT is '${ANDROID_SDK_ROOT}'"
exit 1
fi
if [ -z "${ANDROID_NDK_ROOT}" ]; then
echo "ERROR: ANDROID_NDK_ROOT is not set for ${USER}. Please set it."
- echo "ANDROID_NDK_ROOT '${ANDROID_NDK_ROOT}'"
exit 1
fi
+if [[ ! -d "${ANDROID_SDK_ROOT}" ]]; then
+ echo "ANDROID_SDK_ROOT does not exist. The directory will be created."
+ if ! mkdir -p "${ANDROID_SDK_ROOT}"; then
+ echo "Failed to create ANDROID_SDK_ROOT '${ANDROID_SDK_ROOT}'."
+ echo "Is ANDROID_SDK_ROOT writeable? Maybe you need to run this script with 'sudo -E'."
+ fi
+fi
+
+if [[ ! -d "${ANDROID_NDK_ROOT}" ]]; then
+ echo "ANDROID_NDK_ROOT does not exist. The directory will be created."
+ if ! mkdir -p "${ANDROID_NDK_ROOT}"; then
+ echo "Failed to create ANDROID_NDK_ROOT '${ANDROID_NDK_ROOT}'."
+ echo "Is ANDROID_NDK_ROOT writeable? Maybe you need to run this script with 'sudo -E'."
+ fi
+fi
+
# Temp directory
if [[ -z "$TMPDIR" ]]; then
TMPDIR="$HOME/tmp"