diff --git a/Hooks/delegator.sh b/Hooks/delegator.sh new file mode 100644 index 0000000..66272da --- /dev/null +++ b/Hooks/delegator.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +. logging.sh +. syntax.sh \ No newline at end of file diff --git a/Hooks/logging.sh b/Hooks/logging.sh index 6eae526..aeeef6c 100644 --- a/Hooks/logging.sh +++ b/Hooks/logging.sh @@ -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 diff --git a/Hooks/syntax.sh b/Hooks/syntax.sh index 9c7dd79..df3638f 100644 --- a/Hooks/syntax.sh +++ b/Hooks/syntax.sh @@ -1,3 +1,5 @@ +#!/bin/sh + git diff --cached --name-only | while read FILE; do if [[ "$FILE" =~ ^.+(php|inc|module|install|test)$ ]]; then