add check if hooks installed

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2019-05-01 12:15:10 +02:00
parent 7c112122e8
commit bcbff7f865
1 changed files with 3 additions and 1 deletions

View File

@ -10,8 +10,10 @@
GIT_DIR=$(git rev-parse --git-dir)
cd "$GIT_DIR/.." || exit 1
[ -f .git/.lastpush ] || echo "No push or hooks not installed, use \"git add\" instead ... Abort" && exit
FILES="$(find ./* -newer .git/.lastpush)"
[ "${FILES}" = "" ] && echo "Noting changed since last push!" && exit
[ "${FILES}" = "" ] && echo "Noting changed since last push ... Abort" && exit
# run pre_commit on files
dev/hooks/pre-commit.sh