Skip to content

Instantly share code, notes, and snippets.

@itsthejb
Created November 7, 2015 18:58
Show Gist options
  • Save itsthejb/cc7f3b594dd5ad77c75c to your computer and use it in GitHub Desktop.
Save itsthejb/cc7f3b594dd5ad77c75c to your computer and use it in GitHub Desktop.
Set bundle build number from count of Git commits + offset
PLIST=${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Info.plist
OFFSET=300
COUNT=$(expr $(git rev-list HEAD --count) + $OFFSET)
/usr/libexec/PlistBuddy -c "Set CFBundleVersion $COUNT" "$PLIST"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment