mirror of
https://github.com/Karaka-Management/Build.git
synced 2026-01-27 18:48:39 +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/filename.sh
|
||||||
. ${rootpath}/Build/Hooks/tests.sh
|
. ${rootpath}/Build/Hooks/tests.sh
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
git diff --cached --name-only | while read FILE; do
|
git diff --cached --name-only | while read FILE; do
|
||||||
if [[ ! -f "$FILE" ]]; then
|
if [[ ! -f "$FILE" ]]; then
|
||||||
continue
|
continue
|
||||||
|
|
@ -64,10 +62,7 @@ git diff --cached --name-only | while read FILE; do
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$FILE" =~ ^.+(sh|js|php|json|css)$ ]]; then
|
if [[ "$FILE" =~ ^.+(sh|js|php|json|css)$ ]]; then
|
||||||
echo 1
|
|
||||||
GEN_SYNTAX=$(hasInvalidBasicSyntax "$FILE")
|
GEN_SYNTAX=$(hasInvalidBasicSyntax "$FILE")
|
||||||
echo 2
|
|
||||||
|
|
||||||
|
|
||||||
if [[ $GEN_SYNTAX = 1 ]]; then
|
if [[ $GEN_SYNTAX = 1 ]]; then
|
||||||
echo -e "\e[1;31m\tFound whitespace at end of line in $FILE.\e[0m" >&2
|
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
|
grep -P '(\<td\>|\<th\>|\<caption\>|\<label.*?(\"|l)\>)[0-9a-zA-Z\.\?]+' "$FILE" >&2
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
exit 0
|
|
||||||
|
|
@ -71,7 +71,7 @@ isValidBashScript() {
|
||||||
}
|
}
|
||||||
|
|
||||||
hasInvalidBasicSyntax() {
|
hasInvalidBasicSyntax() {
|
||||||
echo 1
|
echo 3
|
||||||
echo $1
|
echo $1
|
||||||
# Check whitespace end of line in code
|
# Check whitespace end of line in code
|
||||||
if [[ -n $(grep -P ' $' "$1") ]]; then
|
if [[ -n $(grep -P ' $' "$1") ]]; then
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user