Skip to content

Instantly share code, notes, and snippets.

@grandeforesta
Created February 29, 2012 05:42
Show Gist options
  • Save grandeforesta/1938266 to your computer and use it in GitHub Desktop.
Save grandeforesta/1938266 to your computer and use it in GitHub Desktop.
gitのリビジョン番号をplistに自動的に埋め込む by http://sonson.jp/?p=2241
#svnやgitのリビジョン,ビルド番号をplistに自動的に埋め込む http://sonson.jp/?p=2241
git_revision=$(git show --format='%h' -s)
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE"
/usr/libexec/PlistBuddy -c "Set :CFBundleGitRevision $git_revision" "$INFOPLIST_FILE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment