Add default git hooks

This is a set of global, reusable git hooks that can be added to any git
project
This commit is contained in:
Nick Nisi
2013-07-27 10:58:35 -05:00
parent 12cce8e18d
commit 32e2d1f363
6 changed files with 35 additions and 22 deletions

View File

@@ -1,22 +0,0 @@
#!/bin/sh
EXIT_CODE=0
repo=$( git rev-parse --show-toplevel )
HOOKS=~/.dotfiles/git/hooks
echo "Executing PRE-COMMIT hook(s)"
for hook in $HOOKS/*.pre-commit; do
echo ""
echo "${COLOR_LIGHTPURPLE}Executing ${hook}${COLOR_NONE}"
${hook}
EXIT_CODE=$((${EXIT_CODE} + $?))
done
if [[ ${EXIT_CODE} -ne 0 ]]; then
echo ""
echo "${COLOR_RED}Commit Failed.${COLOR_NONE}"
fi
exit $((${EXIT_CODE}))

View File

@@ -0,0 +1 @@
./run-hooks.sh