Last active
October 21, 2021 20:53
-
-
Save b2evandro/9ff0e8355314f2f11a6696f56d00e8af to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "ATUALIZANDO VERSAO DO ANDROID" | |
versaoCode="$(cat android/app/build.gradle | grep 'versionCode ' | xargs | cut -d' ' -f2)" | |
versaoCodeAtualizado=$(bc <<< "$versaoCode + 1") | |
versaoName="$(cat android/app/build.gradle | grep 'versionName ' | xargs | cut -d' ' -f2)" | |
versaoNameAtualizado=$(bc <<< "$versaoName + 0.01") | |
sed -i '' "s/versionCode ${versaoCode}/versionCode ${versaoCodeAtualizado}/" android/app/build.gradle | |
sed -i '' 's/versionName [0-9a-zA-Z -_]*/versionName "'"$versaoNameAtualizado"'"/' android/app/build.gradle | |
echo "versionCode Atual $versaoCode ===> Novo $versaoCodeAtualizado" | |
echo "versionName Atual $versaoName ===> Novo $versaoNameAtualizado" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment