cfg/bin/git-pot
Knut Ahlers 20e7c554fc
Implement auto-loading of SSH keys
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2017-08-08 11:56:36 +02:00

29 lines
518 B
Bash
Executable file

#!/bin/bash -e
set -o pipefail
set -e
STEP_COLOR="\033[0;36m"
NO_COLOR="\033[0m"
function step {
echo -e ${STEP_COLOR}[$(date +%H:%M:%S)] $1${NO_COLOR}
}
### Determine what to push
step "Getting current branch"
CURRENT_BRANCH=$(git branch --list | awk '/^\*/{print $2}')
step "Loading required key to push"
git loadkey
step "Execute pre-push auto-hook"
git autohook pre-push
step "Execute pushes..."
git push origin ${CURRENT_BRANCH} --tags "$@"
step "Execute post-push auto-hook"
git autohook post-push