summaryrefslogtreecommitdiffstats
path: root/roles/prerec/templates/update-task-status.sh
blob: e8f0ff817956742ebb17cbeec587a2fb7c003614 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
# {{ ansible_managed }}
# How to use: update-task-status.sh slug from-status-regexp to-status
# or update-task-status.sh slug to-status

SLUG="$1"
FROM_STATUS="$2"
TO_STATUS="$3"
if [ "x$TO_STATUS" == "x" ]; then
    FROM_STATUS=.
    TO_STATUS="$2"
fi
cd {{ emacsconf_private_dir }}
echo "Pulling conf.org..."
git pull
echo "Updating status..."
emacsclient -a emacs --eval "(emacsconf-with-todo-hooks (emacsconf-update-talk-status \"$SLUG\" \"$FROM_STATUS\" \"$TO_STATUS\"))"
echo "Committing and pushing in the background"
git commit -m "Update task status for $SLUG from $FROM_STATUS to $TO_STATUS" conf.org
git push &