mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2025-01-14 18:09:48 +00:00
add post-commit hook
This commit is contained in:
parent
69ca15a9d2
commit
f4d64f7b0c
24
dev/hooks/post-commit.sh
Executable file
24
dev/hooks/post-commit.sh
Executable file
@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
#### $$VERSION$$ v1.2-dev2-63-g69ca15a
|
||||
|
||||
############
|
||||
# NOTE: you MUST run install-hooks.sh again when updating this file!
|
||||
|
||||
# magic to ensure that we're always inside the root of our application,
|
||||
# no matter from which directory we'll run script
|
||||
GIT_DIR=$(git rev-parse --git-dir)
|
||||
cd "$GIT_DIR/.." || exit 1
|
||||
|
||||
export HOOKDIR="dev/hooks"
|
||||
LASTPUSH='.git/.lastcommit'
|
||||
|
||||
# if any command inside script returns error, exit and return that error
|
||||
set -e
|
||||
|
||||
#echo "Running post-commit hook"
|
||||
#echo "............................"
|
||||
|
||||
unset IFS; set -f
|
||||
|
||||
# note date of last push for version
|
||||
touch "${LASTPUSH}"
|
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# this has to run once atfer git clone
|
||||
# and every time we create new hooks
|
||||
#### $$VERSION$$ v1.2-0-gc50499c
|
||||
#### $$VERSION$$ v1.2-dev2-63-g69ca15a
|
||||
|
||||
# magic to ensure that we're always inside the root of our application,
|
||||
# no matter from which directory we'll run script
|
||||
@ -15,7 +15,7 @@ fi
|
||||
HOOKDIR="dev/hooks"
|
||||
|
||||
echo -n "Installing hooks..."
|
||||
for hook in pre-commit pre-push
|
||||
for hook in pre-commit post-commit pre-push
|
||||
do
|
||||
rm -f "${GIT_DIR}/hooks/${hook}"
|
||||
if [ -f "${HOOKDIR}/${hook}.sh" ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user