Skip to content

Instantly share code, notes, and snippets.

@forbze
Created September 22, 2015 11:14
Show Gist options
  • Save forbze/e1aacd2b123a616196b1 to your computer and use it in GitHub Desktop.
Save forbze/e1aacd2b123a616196b1 to your computer and use it in GitHub Desktop.
git=$(sh /etc/profile; which git)
number_of_commits=$("$git" rev-list HEAD --count)
bundle_version=$number_of_commits
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 $bundle_version" "$plist"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment