fix script

This commit is contained in:
Alexander Mahr 2024-12-25 13:59:25 +01:00
parent 878008f913
commit 27f4077ac8

View file

@ -1,15 +1,20 @@
#!/bin/bash
set -x
. app-config.sh
type sdkmanager 2>/dev/null || {
# get configuration
source app-config.sh
# in case needed download and install `sdkmanager`
type sdkmanager 2>/dev/null || (
BUILD_TOOLS="$(realpath -m "$BUILD_TOOLS_LATEST/..")"
mkdir -p "$BUILD_TOOLS"
cd "$BUILD_TOOLS"
for LATESTTOOLS in \
"$(curl https://developer.android.com/studio#command-line-tools-only | grep -e 'https://dl.google.com/android/repository/commandlinetools-linux-.*_latest.zip' | cut -f2 -d'"')" \
'https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip' ;\
"$(curl 'https://developer.android.com/studio#command-line-tools-only' |
grep -e 'https://dl.google.com/android/repository/commandlinetools-linux-.*_latest.zip' | cut -f2 -d'"')" \
'https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip'
do
echo "testing to get '$LATESTTOOLS'"
echo test "${LATESTTOOLS:0:22}" = "https://dl.google.com/" -a "${LATESTTOOLS:(-11)}" = "_latest.zip"
@ -22,12 +27,12 @@ type sdkmanager 2>/dev/null || {
echo "error downloading working cmdline-tools.zip"
exit 1
}
done;\
done
ls
ls cmdline-tools
rm cmdline-tools.zip;\
rm cmdline-tools.zip
mv -v cmdline-tools "$BUILD_TOOLS_LATEST" || true
}
)
test -f android-sdk/.installed.buildtools.version.$APP_VERSION_SDK_TARGET || {
EXACTVERSION_BUILDTOOLS="$(