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

View File

@ -10,8 +10,10 @@
GIT_DIR=$(git rev-parse --git-dir) GIT_DIR=$(git rev-parse --git-dir)
cd "$GIT_DIR/.." || exit 1 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="$(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 # run pre_commit on files
dev/hooks/pre-commit.sh dev/hooks/pre-commit.sh