Files
commandergenius/project/jni/application/openttd/download-data.sh

28 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/env bash
set -e
GFX_VERSION=7.1
SFX_VERSION=1.0.3
MSX_VERSION=0.4.2
ANDROID_DATA_FULLPATH=$(realpath ./AndroidData/)
GFX_VERSION=$(curl --fail https://cdn.openttd.org/opengfx-releases/latest.yaml | grep -Po "version: \K[0-9.]+")
SFX_VERSION=$(curl --fail https://cdn.openttd.org/opensfx-releases/latest.yaml | grep -Po "version: \K[0-9.]+")
MSX_VERSION=$(curl --fail https://cdn.openttd.org/openmsx-releases/latest.yaml | grep -Po "version: \K[0-9.]+")
# Base game data
pushd ./data-plat-indp
if ! [ -e "./opengfx-${GFX_VERSION}.tar" ]; then
curl --fail https://cdn.openttd.org/opengfx-releases/${GFX_VERSION}/opengfx-${GFX_VERSION}-all.zip | jar xv
fi
if ! [ -e "./opensfx-${SFX_VERSION}.tar" ]; then
curl --fail https://cdn.openttd.org/opensfx-releases/${SFX_VERSION}/opensfx-${SFX_VERSION}-all.zip | jar xv
fi
if ! [ -d "./openmsx-${MSX_VERSION}/" ]; then
curl --fail https://cdn.openttd.org/openmsx-releases/${MSX_VERSION}/openmsx-${MSX_VERSION}-all.zip | jar xv
tar xvf ./openmsx-${MSX_VERSION}.tar && rm ./openmsx-${MSX_VERSION}.tar
fi