Created
September 13, 2016 04:00
-
-
Save marcisme/7a27cd6ba0f090cdc2b4586f072221d3 to your computer and use it in GitHub Desktop.
This file contains 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/sh | |
git=$(sh /etc/profile; which git) | |
git_release_version=$("$git" describe --tags --always --abbrev=0) | |
number_of_commits=$("$git" rev-list master | wc -l | tr -d ' ') | |
target_plist="$TARGET_BUILD_DIR/$INFOPLIST_PATH" | |
dsym_plist="$DWARF_DSYM_FOLDER_PATH/$DWARF_DSYM_FILE_NAME/Contents/Info.plist" | |
for plist in "$target_plist" "$dsym_plist"; do | |
if [ -f "$plist" ]; then | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $number_of_commits" "$plist" | |
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString ${git_release_version#*v}" "$plist" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After using this script I am not able to get the version and build number programmatically. Also when I am trying to upload the build to the app store I am getting this error. "The Info.plist in the package must contain the CFBundleShortVersionString key".