summaryrefslogtreecommitdiff
path: root/TestScripts/install-ndk.sh
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2021-02-07 12:50:39 -0500
committerJeffrey Walton <noloader@gmail.com>2021-02-07 12:50:39 -0500
commit44aa94152e66273467f037aaf46346e94c030f94 (patch)
treec5678e93cf5c43e08ea3f4705ec3be0b69762149 /TestScripts/install-ndk.sh
parente898f55e747cbb3fcf6cc3f4982468376b65932f (diff)
downloadcryptopp-git-44aa94152e66273467f037aaf46346e94c030f94.tar.gz
Update test scripts
Diffstat (limited to 'TestScripts/install-ndk.sh')
-rwxr-xr-xTestScripts/install-ndk.sh28
1 files changed, 6 insertions, 22 deletions
diff --git a/TestScripts/install-ndk.sh b/TestScripts/install-ndk.sh
index 287dfc2b..c1434811 100755
--- a/TestScripts/install-ndk.sh
+++ b/TestScripts/install-ndk.sh
@@ -35,6 +35,12 @@
# Mac: https://dl.google.com/android/repository/platform-tools-latest-darwin.zip
# Windows: https://dl.google.com/android/repository/platform-tools-latest-windows.zip
+function cleanup {
+ # Cleanup downloads
+ rm -f android-sdk.zip android-ndk.zip platform-tools.zip
+}
+trap cleanup EXIT
+
if [ -z "${ANDROID_SDK_ROOT}" ]; then
echo "ERROR: ANDROID_SDK_ROOT is not set for ${USER}. Please set it."
exit 1
@@ -45,24 +51,6 @@ if [ -z "${ANDROID_NDK_ROOT}" ]; then
exit 1
fi
-if false; then
-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
-fi # false
-
# Temp directory
if [[ -z "${TMPDIR}" ]]; then
TMPDIR="$HOME/tmp"
@@ -159,10 +147,6 @@ fi
fi
)
-rm -f android-sdk.zip
-rm -f android-ndk.zip
-rm -f platform-tools.zip
-
# We don't set ANDROID_HOME to ANDROID_SDK_ROOT.
# https://stackoverflow.com/a/47028911/608639
touch "${ANDROID_SDK_ROOT}/repositories.cfg"