Created
September 23, 2021 00:46
-
-
Save bensig/fc3792301e5f99d6c9552aa6d9738c06 to your computer and use it in GitHub Desktop.
Bash Script to Update Expo App Version Code
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 | |
# Script to bump expo.js version code | |
# get current versions | |
currentVersion=`cat app.json|jq '.[] | .android | .versionCode'` | |
# show current versions | |
echo "The current version is: $currentVersion" | |
# get new version from user input | |
read -p "Enter new version number: " newVersion | |
echo "" | |
# change to new version | |
jq -r '.[].android.versionCode |= '$newVersion'' app.json > temp.json | |
# rename temp file | |
mv temp.json app.json | |
# display updated versions | |
updatedVersion=`cat app.json|jq '.[] | .android | .versionCode'` | |
echo "The version has been updated to: $updatedVersion" | |
# tag version for release | |
git add . | |
git tag release-$updatedVersion | |
git commit -m "Increment version for release-$updatedVersion" | |
echo "To finish run:" | |
echo "git push --tags && git push" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment