Skip to content

Instantly share code, notes, and snippets.

@sarunw
Created January 31, 2015 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sarunw/9ba2593d0cb21d553005 to your computer and use it in GitHub Desktop.
Save sarunw/9ba2593d0cb21d553005 to your computer and use it in GitHub Desktop.
Auto increment build number of xcode based on git commit.
echo "CONFIG $CONFIGURATION"
if [ "$CONFIGURATION" != "Release" ]; then
exit 0
fi
BUILD_NUMBER=$(git rev-list HEAD --count)
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $BUILD_NUMBER" "$INFOPLIST_FILE"
# For debugging:
echo "BUILD NUMBER: $BUILD_NUMBER"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment