Created
October 25, 2013 17:33
-
-
Save rickfillion/7158618 to your computer and use it in GitHub Desktop.
git pre-commit hook for stopping you from commiting xibs that are in the new Xcode5 format that won't load in Xcode4. Surely there's a better way to find xibs that are in the new format than this, but it seems to work so far. To use: Save as .git/hooks/pre-commit.
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/sh | |
# | |
# Pre-Commit Hook that checks for Xcode5 format XIB files as they won't be | |
# openable in Xcode4 | |
# Redirect output to stderr. | |
exec 1>&2 | |
xcode5xibs=`find . -name *.xib -exec grep "<document.*type=\"com.apple.InterfaceBuilder3.Cocoa.XIB\"" {} + | sed -e 's/:.*//'` | |
if [ "$xcode5xibs" != "" ] | |
then | |
echo "Error: Attempt to add an Xcode5 xib file" | |
echo "$xcode5xibs" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment