Created
January 31, 2013 00:07
-
-
Save neonichu/4678613 to your computer and use it in GitHub Desktop.
Shell script for showing differences between working copy and committed state of Xcode projects.
Uses the xcodeproj commandline utitlity from the xcodeproj Gem.
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/sh | |
| ## | |
| # Git diff for Xcode projects | |
| # | |
| # $ sudo gem install xcodeproj | |
| ## | |
| if [ -z "$DIFF" ] | |
| then | |
| DIFF=diff | |
| fi | |
| if [ -z "$1" ] | |
| then | |
| export GIT_EXTERNAL_DIFF=$0 | |
| git diff | |
| else | |
| if echo "$2"|grep '.pbxproj$' >/dev/null 2>&1 | |
| then | |
| TMP=`mktemp -d /tmp/tmp.XXXXXX` && | |
| cp "$2" "$TMP/project.pbxproj" && | |
| xcodeproj project-diff "$TMP" "`dirname "$5"`" | |
| rm -f "$TMP/project.pbxproj" | |
| rmdir "$TMP" | |
| fi | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment