From 5e169b1f8fef53ee00c4d1fed01f52484c44918b Mon Sep 17 00:00:00 2001 From: Antoine Rybacki <15911822+Lifeismana@users.noreply.github.com> Date: Wed, 6 Nov 2024 12:14:52 +0100 Subject: [PATCH] only update if current version code is greater than previous --- script.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script.sh b/script.sh index cde84d2..c210598 100755 --- a/script.sh +++ b/script.sh @@ -45,7 +45,7 @@ ProcessApp() echo "Processing $1" previous_version='' if [[ -f $1/resources/AndroidManifest.xml ]]; then - previous_version=$(xpath -q -e "string(/manifest/@android:versionName)" $1/resources/AndroidManifest.xml) + previous_version=$(xpath -q -e "string(/manifest/@android:versionCode)" $1/resources/AndroidManifest.xml) fi echo "Previous version: $previous_version" rm -rf $1 @@ -112,10 +112,10 @@ ProcessApp() current_version='' if [[ -f $1/resources/AndroidManifest.xml ]]; then - current_version=$(xpath -q -e "string(/manifest/@android:versionName)" $1/resources/AndroidManifest.xml) + current_version=$(xpath -q -e "string(/manifest/@android:versionCode)" $1/resources/AndroidManifest.xml) fi echo "Current version: $current_version" - if [ -n "$APP_TO_PROCESS" ] || [ "$previous_version" != "$current_version" ] || [ -n "$FORCE" -a "$FORCE" = "true" ]; then + if [ -n "$APP_TO_PROCESS" ] || [ "$current_version" -gt "$previous_version" ] || [ -n "$FORCE" -a "$FORCE" = "true" ]; then git add $1 else echo "Skipping staging changes: apk version didn't change"