Created
May 29, 2017 13:16
-
-
Save ManWithBear/7436165b4337adf688b4fd0176a19129 to your computer and use it in GitHub Desktop.
Build version bump in yyyymmddxx format
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
releaseName=`date '+%Y%m%d'` | |
oldRelease=`cat {project name}/SupportFiles/Info.plist | sed -n '/CFBundleVersion/{n;p;}' | cut -d '>' -f2 | cut -d '<' -f1` | |
oldTemp=${oldRelease:0:8} | |
if [ $oldTemp == $releaseName ] | |
then | |
suffix=${oldRelease:8} | |
suffix=$(($suffix + 1)) | |
printf -v suffix "%02d" $suffix | |
else | |
suffix=01 | |
fi | |
CFVersion=$releaseName$suffix | |
echo $CFVersion | |
cat {project name}/SupportFiles/Info.plist | sed -n '/CFBundleVersion/{p;n;s/>.*</>'$CFVersion'</;};p' > temp.plist | |
mv temp.plist {project name}/SupportFiles/Info.plist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment