mirror of
https://github.com/Karaka-Management/Build.git
synced 2026-01-11 03:38:40 +00:00
Fix new hooks
This commit is contained in:
parent
d8750c90dd
commit
f56dd74de6
|
|
@ -64,11 +64,13 @@ git diff --cached --name-only | while read FILE; do
|
|||
fi
|
||||
|
||||
if [[ "$FILE" =~ ^.+(sh|js|php|json|css)$ ]]; then
|
||||
echo 0
|
||||
echo $FILE
|
||||
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
|
||||
grep -P ' $' $FILE >&2
|
||||
|
|
|
|||
|
|
@ -71,10 +71,7 @@ isValidBashScript() {
|
|||
}
|
||||
|
||||
hasInvalidBasicSyntax() {
|
||||
# Check whitespace end of line in code
|
||||
if [[ -n $(grep -P ' $' "$1") ]]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
# Check for tabs
|
||||
if [[ -n $(grep -P '\t' "$1") ]]; then
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user