remove git-hooks

This commit is contained in:
Jorge Morante 2020-12-27 20:04:09 +01:00
parent ed1fff18d1
commit b5ab752b98
2 changed files with 0 additions and 37 deletions

View File

@ -1,8 +0,0 @@
#!/usr/bin/env bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
GIT_DIR=$CURRENT_DIR/../.git
GIT_HOOKS_DIR=$GIT_DIR/hooks
rm -rf "$GIT_HOOKS_DIR"
ln -s "$CURRENT_DIR" "$GIT_HOOKS_DIR"

View File

@ -1,29 +0,0 @@
#!/usr/bin/env bash
current_branch=$(git rev-parse --abbrev-ref HEAD)
if [[ ${current_branch} != "master" ]]; then
exit 0
fi
echo "Pushing to master? Let me run some pre-push hooks ..."
grep_debug='git grep -n "debug.sh" -- *.sh'
grep_log_calls='git grep -n "log " -- *.sh'
WHITE_LIST_SCRIPTS="^(\\.git-hooks)"
include_debug_count=$(eval "$grep_debug" | grep -v $WHITE_LIST_SCRIPTS | wc -l)
log_calls_count=$(eval "$grep_log_calls" | grep -v $WHITE_LIST_SCRIPTS | wc -l)
if [[ $((include_debug_count + log_calls_count)) -gt 1 ]]; then
echo "Remove debug traces!"
echo ""
eval "$grep_debug" > /dev/stdout
eval "$grep_log_calls" > /dev/stdout
exit 1
fi
# TODO for some reason, tests fail when ran from pre-push hook ( WTF? )
if [[ -z $I_ASSURE_YOU_TESTS_ARE_PASSING ]]; then
echo ""
echo "Run ./test/run.sh before pushing to master. Then set I_ASSURE_YOU_TESTS_ARE_PASSING variable to bypass this" | fold -sw 80
exit 1
fi