aboutsummaryrefslogtreecommitdiff
path: root/bot/sx-bot.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bot/sx-bot.sh')
-rwxr-xr-xbot/sx-bot.sh20
1 files changed, 13 insertions, 7 deletions
diff --git a/bot/sx-bot.sh b/bot/sx-bot.sh
index 22c7284..32f6123 100755
--- a/bot/sx-bot.sh
+++ b/bot/sx-bot.sh
@@ -1,6 +1,9 @@
-#!/usr/bin/bash
+#!/usr/bin/env bash
+
+[[ -z "$EMACS" ]] && EMACS="emacs";
DESTINATION_BRANCH=data
+CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
function notify-done {
local title
@@ -20,17 +23,20 @@ function notify-done {
}
function generate-tags {
- emacs -Q --batch \
- -L "./" -L "./bot/" -l sx-bot \
- -f sx-bot-fetch-and-write-tags
- ret = $?
+ $EMACS -Q --batch \
+ -L "./" -L "./bot/" -l sx-bot \
+ -f sx-bot-fetch-and-write-tags
+ ret=$?
notify-done
return ${ret}
}
-git branch ${DESTINATION_BRANCH} &&
+git checkout ${DESTINATION_BRANCH} &&
git pull &&
generate-tags &&
git stage data/ &&
git commit -m "Update tag data" &&
- echo 'Ready for "git push"'
+ git push &&
+ echo 'Bot finished.'
+
+git checkout ${CURRENT_BRANCH}