Created
August 20, 2013 15:48
-
-
Save vclwei/6283272 to your computer and use it in GitHub Desktop.
This file contains 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 | |
INFO_PLIST="${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Info" | |
HASHVERSION=$(git --git-dir="${PROJECT_DIR}/.git" --work-tree="${PROJECT_DIR}" rev-parse --short HEAD) | |
defaults write $INFO_PLIST AutoHashVersion $HASHVERSION |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment