Created
August 8, 2015 00:27
-
-
Save Scuilion/9b061d096976d34bdfcd 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 | |
files=$(git diff --name-only HEAD | tr '\n' ' ' ) | |
e=0 | |
for f in $files | |
do | |
if ! git show :"$f" | iconv -f UTF-8 -t UTF-8 "$f" >/dev/null 2>&1 | |
then | |
e=1 | |
echo "The following file is not UTF-8: $f" | |
fi | |
done | |
exit $e | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment