Created
June 10, 2014 09:30
-
-
Save ishaq/167ef4940f8615f5ac19 to your computer and use it in GitHub Desktop.
This script stops the build if git repository has uncommitted changes, useful when archiving because it makes sure releases (Archives) are created from a clean tree. Put this script in a target (say ArchiveHousekeeper) and update target scheme's Build section to add ArchiveHousekeeper as dependency for Archive operation.
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 | |
if [ -z "$(git status --porcelain)" ]; then | |
echo "Working directory clean, proceding to Archive" | |
exit 0 | |
else | |
echo "error: Working directory dirty, stopping build" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment