#!/bin/bash . $HOME/.shenv set -e lisp=$(cat <&2 "run this script only on MetaArray"; exit 1 ) # 1. git update # Thanks to `set -e' above, any failure to fast-forward will mean I # get an e-mail from crond telling me to resolve the merge. for dir in "$HOME/doc $HOME/doc/www $HOME/doc/www/blog"; do cd $dir git pull --ff-only done # 2. prepare publishing destinations # this is why this script cannot be executed locally! mkdir -p $HOME/lib/fm/{,dionysus/Agenda} # [ "$(ls -A $HOME/lib/fm)" ] \ # && echo >&2 "target dir not empty!" && exit 1 # 3. have Org publish emacs -batch \ -l $HOME/.emacs.d/init.el \ -l $HOME/.emacs.d/init-org.el \ -eval "$lisp" # 4. cleanup cd $HOME/lib/fm webdav_dir "Philos notes" cd $HOME/lib/fm webdav_dir "dionysus/Agenda" rm -r $HOME/lib/fm/* rdate.py-dir $HOME/html/blog/entries