Created
July 31, 2017 10:57
-
-
Save rmcauley/2913cd4965b56700323f83ee8bbbf5c2 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
failed="no" | |
find . -name '*.py' -not -path "./.env/*" -not -path "./node_modules/*" -print0 | | |
while IFS= read -r -d $'\0' line; do | |
if [ -s $line ]; then | |
grep -L "from __future__ import unicode_literals" $line | |
if [ "$?" -ne "0" ]; then | |
failed="yes" | |
fi | |
fi | |
done | |
if [ $failed != "no" ]; then | |
echo | |
echo "The above files are not UTF-8 safe. Please add this to the top of the files:" | |
echo | |
echo "# -*- coding: utf-8 -*-" | |
echo | |
echo "from __future__ import unicode_literals" | |
echo | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment