Skip to content

Instantly share code, notes, and snippets.

@czwen
Created December 1, 2015 07:59
Show Gist options
  • Save czwen/921113eb3435e58eb3b6 to your computer and use it in GitHub Desktop.
Save czwen/921113eb3435e58eb3b6 to your computer and use it in GitHub Desktop.
根据commit生成build号
git=`sh /etc/profile; which git`
appBuild=`"$git" rev-list --count HEAD`
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $appBuild" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
echo "Updated ${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment