Testing hooks

This commit is contained in:
Dennis Eichhorn 2018-06-24 16:50:00 +02:00
parent 0a7c6a5550
commit 1810a203a9
3 changed files with 10 additions and 2 deletions

4
Hooks/delegator.sh Normal file
View File

@ -0,0 +1,4 @@
#!/bin/sh
. logging.sh
. syntax.sh

View File

@ -1,5 +1,7 @@
#!/bin/sh
git diff --cached --name-only | while read FILE; do
if [[ "$FILE" =~ ^.+(php|js)$ ]]; then
if [[ "$FILE" =~ ^.+(php)$ ]]; then
RESULT=$(grep "var_dump(" "$FILE")
if [ ! -z $RESULT ]; then
echo -e "\e[1;33m\tWarning, the commit contains a call to var_dump(). Commit was not aborted, however.\e[0m" >&2
@ -8,7 +10,7 @@ fi
done
git diff --cached --name-only | while read FILE; do
if [[ "$FILE" =~ ^.+(php|js)$ ]]; then
if [[ "$FILE" =~ ^.+(js)$ ]]; then
RESULT=$(grep "console.log(" "$FILE")
if [ ! -z $RESULT ]; then
echo -e "\e[1;33m\tWarning, the commit contains a call to console.log(). Commit was not aborted, however.\e[0m" >&2

View File

@ -1,3 +1,5 @@
#!/bin/sh
git diff --cached --name-only | while read FILE; do
if [[ "$FILE" =~ ^.+(php|inc|module|install|test)$ ]]; then