Fix new hooks

This commit is contained in:
Dennis Eichhorn 2018-08-11 12:07:33 +02:00
parent 267b006602
commit 611eaef06c
2 changed files with 2 additions and 9 deletions

View File

@ -5,8 +5,6 @@
. ${rootpath}/Build/Hooks/filename.sh
. ${rootpath}/Build/Hooks/tests.sh
set -e
git diff --cached --name-only | while read FILE; do
if [[ ! -f "$FILE" ]]; then
continue
@ -64,10 +62,7 @@ git diff --cached --name-only | while read FILE; do
fi
if [[ "$FILE" =~ ^.+(sh|js|php|json|css)$ ]]; then
echo 1
GEN_SYNTAX=$(hasInvalidBasicSyntax "$FILE")
echo 2
if [[ $GEN_SYNTAX = 1 ]]; then
echo -e "\e[1;31m\tFound whitespace at end of line in $FILE.\e[0m" >&2
@ -124,6 +119,4 @@ git diff --cached --name-only | while read FILE; do
grep -P '(\<td\>|\<th\>|\<caption\>|\<label.*?(\"|l)\>)[0-9a-zA-Z\.\?]+' "$FILE" >&2
fi
fi
done
exit 0
done

View File

@ -71,7 +71,7 @@ isValidBashScript() {
}
hasInvalidBasicSyntax() {
echo 1
echo 3
echo $1
# Check whitespace end of line in code
if [[ -n $(grep -P ' $' "$1") ]]; then