Created
July 27, 2018 11:10
-
-
Save akkyie/102b04b3e55c10398bf3eda3850016c3 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
#!/usr/bin/env bash | |
if [[ $# < 1 ]]; then | |
echo "USAGE: $0 PATTERNS" | |
exit 1 | |
fi | |
IFS=$'\n' | |
for PATTERN in "$@"; do | |
STATUS=$(git status $PATTERN --porcelain) | |
if [[ $STATUS != "" ]]; then | |
echo "$PATTERN changed" | |
exit 1 | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment