Created
April 23, 2015 22:51
-
-
Save jpotts18/f72569fe11c7dfadebd7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script automatically sets the version and short version string of | |
# an Xcode project from the Git repository containing the project. | |
# | |
# To use this script in Xcode 4, add the contents to a "Run Script" build | |
# phase for your application target. | |
set -o errexit | |
set -o nounset | |
GIT_COMMIT=$(git rev-parse --verify HEAD | cut -c 1-7) | |
GIT_COMMIT_COUNT=$(git rev-list master | wc -l) | |
# GIT_TAG=$(git describe --abbrev=0) | |
defaults write $PRODUCT_SETTINGS_PATH GitCommit $GIT_COMMIT | |
defaults write $PRODUCT_SETTINGS_PATH CommitCount $GIT_COMMIT_COUNT | |
# defaults write $PRODUCT_SETTINGS_PATH GitTag $GIT_TAG |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment