increment_version: Ensure higher version code than previous test builds

Change-Id: Ia48c13930ca1a26b43a4bb71fd642e0d7d139b60
This commit is contained in:
SpiritCroc 2021-01-16 18:44:33 +01:00
parent 4a95b69fcd
commit 9687bacd9a

View file

@ -89,6 +89,15 @@ if [ "$release_type" = "test" ]; then
versionCode=$((previousVersionCode + 1)) versionCode=$((previousVersionCode + 1))
else else
versionCode=$((previousVersionCode + 10)) versionCode=$((previousVersionCode + 10))
# Ensure the new version code is higher than the one of the last test version
if [ -f "$HOME/fdroid/sm/data/metadata/de.spiritcroc.riotx.a.yml" ]; then
lastTestVersionCode="$(cat "$HOME/fdroid/sm/data/metadata/de.spiritcroc.riotx.a.yml"|grep versionCode|tail -n 1|sed 's|.*: ||')"
else
read -p "Enter versionCode of last test version: " lastTestVersionCode
fi
while [ "$lastTestVersionCode" -ge "$versionCode" ]; do
versionCode=$((versionCode + 10))
done
fi fi