aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Allred <code@seanallred.com>2015-01-02 22:53:38 -0500
committerSean Allred <code@seanallred.com>2015-01-02 22:57:29 -0500
commitacb2f6061799d671969927d9bdc5f4107e3f1680 (patch)
treed24b2e948a38455cdeda3dd11cd1043ad11d881b
parent1cc7f6ea074457bc0d6d1d917f082459710eb809 (diff)
Update sx-bot.sh
Send a notifcation when tags have finished. Function `notify-done' can be extended for other operating systems. For example, I believe Red Hat has `notify-send'.
-rwxr-xr-xbot/sx-bot.sh38
1 files changed, 33 insertions, 5 deletions
diff --git a/bot/sx-bot.sh b/bot/sx-bot.sh
index 76001af..6a5df17 100755
--- a/bot/sx-bot.sh
+++ b/bot/sx-bot.sh
@@ -1,8 +1,36 @@
#!/usr/bin/bash
-git branch gh-pages &&
+DESTINATION_BRANCH=gh-pages
+
+function notify-done {
+ local title
+ local message
+ title="SX Tag Bot"
+ message="Finished retrieving tag lists"
+ case $(uname | tr '[[:upper:]]' '[[:lower:]]') in
+ darwin)
+ terminal-notifier \
+ -message ${message} \
+ -title ${title} \
+ -sound default
+ ;;
+ *)
+ echo ${message}
+ esac
+}
+
+function generate-tags {
+ 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 pull &&
- emacs -Q --batch -L "./" -L "./bot/" -l sx-bot -f sx-bot-fetch-and-write-tags &&
- git commit . &&
- git push &&
- echo SUCCESS
+ generate-tags &&
+ git stage data/ &&
+ git commit -m "Update tag data" &&
+ echo 'Ready for "git push"'