cfg/bin/git-c
2017-09-19 12:10:53 +02:00

34 lines
747 B
Bash
Executable file

#!/bin/bash -e
set -o pipefail
set -e
source "${HOME}/bin/script_framework.sh"
### Fix committer email by repo
step "Ensure correct committer email..."
git setmail
### Commit
step "Loading passphrase for GPG key..."
vault-gpg $(git config user.signingkey)
step "Execute pre-commit auto-hook"
git autohook pre-commit
step "Issuing commit..."
git commit -S -s -v "$@"
step "Execute post-commit auto-hook"
git autohook post-commit
### Count productivity habit
step "Recording work..."
PROD_TASK=$(habitica https://habitica.com/api/v3/tasks/user | jq -r '.data | map(select(.text=="productivity").id)[0]')
if ! ( habitica -sS -o /dev/null -X POST https://habitica.com/api/v3/tasks/${PROD_TASK}/score/up ); then
echo "Scoring failed."
fi