Fix output bug

This commit is contained in:
Dennis Eichhorn 2018-07-14 18:35:23 +02:00
parent b151b809cf
commit 2ebcaf25e9

View File

@ -104,16 +104,16 @@ fi
# text files in general # text files in general
if [[ "$FILE" =~ ^.+(sh|js|php|json|css)$ ]]; then if [[ "$FILE" =~ ^.+(sh|js|php|json|css)$ ]]; then
# Check whitespace end of line in code # Check whitespace end of line in code
if [[ -n $(grep -E ' $' $FILE) ]]; then if [[ -n $(grep -P ' $' $FILE) ]]; then
echo -e "\e[1;31m\tFound whitespace at end of line.\e[0m" >&2 echo -e "\e[1;31m\tFound whitespace at end of line.\e[0m" >&2
echo grep -E ' $' $FILE >&2 grep -P ' $' $FILE >&2
exit 1 exit 1
fi fi
# Check for tabs # Check for tabs
if [[ -n $(grep -P '\t' $FILE) ]]; then if [[ -n $(grep -P '\t' $FILE) ]]; then
echo -e "\e[1;31m\tFound tab instead of whitespace.\e[0m" >&2 echo -e "\e[1;31m\tFound tab instead of whitespace.\e[0m" >&2
echo grep -P '\t' $FILE >&2 grep -P '\t' $FILE >&2
exit 1 exit 1
fi fi
fi fi