From a6fb9f9d46b69f3be6d200d032320cd0a19caa19 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Mon, 26 Aug 2024 19:14:55 +0100 Subject: [PATCH] chore: Update `install_android_sdk` script to download Android SDK from a specified URL --- bin/install_android_sdk | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 bin/install_android_sdk diff --git a/bin/install_android_sdk b/bin/install_android_sdk new file mode 100644 index 0000000..3ba1b69 --- /dev/null +++ b/bin/install_android_sdk @@ -0,0 +1,20 @@ +#!/usr/bin/env sh + +set -euo pipefail + +URL="${1:-}" + +if [ -z "$URL" ]; then + echo "URL is required. Get it from here: https://stackoverflow.com/a/78890086/7009800" + exit 1 +fi + +curl -fsSL \ + --output-dir ~ \ + --output android-clt.zip \ + "$URL" + +cd ~ +unzip android-clt.zip +mkdir -p "$ANDROID_HOME/cmdline-tools/latest" +mv ~/cmdline-tools/* "$ANDROID_HOME/cmdline-tools/latest"