mirror of
https://github.com/Karaka-Management/Build.git
synced 2026-01-11 11:48:40 +00:00
Fix new hooks
This commit is contained in:
parent
267b006602
commit
611eaef06c
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user