fix with old cut version before 8.25

This commit is contained in:
Laurent Rineau
2017-08-23 15:55:49 +02:00
parent 06faec1e7c
commit 3e61b2c649
@@ -128,7 +128,7 @@ fi
#check no file contains non-utf8 characters
echo '.. Checking if non utf-8 characters are used...'
txt_not_utf8=$(git ls-files -z --stage | cut -z -f2- | xargs -0 file -N | grep "text" | egrep -v "UTF-8|ASCII|XML|EPS|FIG|assembler source|Perl script|from flex")
txt_not_utf8=$(git ls-files -z --stage | awk -F"\t" 'BEGIN { RS="\0" }; { printf "%s\0", $2; }' | xargs -0 file -N | grep "text" | egrep -v "UTF-8|ASCII|XML|EPS|FIG|assembler source|Perl script|from flex")
if [ -n "${txt_not_utf8}" ]; then
echo "The following files have non utf-8 characters:"
echo ${txt_not_utf8}