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:
@@ -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}))
|
||||
1
git/templates/hooks/pre-commit
Symbolic link
1
git/templates/hooks/pre-commit
Symbolic link
@@ -0,0 +1 @@
|
||||
./run-hooks.sh
|
||||
Reference in New Issue
Block a user