]> git.donarmstrong.com Git - bin.git/blob - update_org_files
save org mode buffers before calling update_org_files and update_org_ical
[bin.git] / update_org_files
1 #!/bin/bash
2
3 ORG_GREP='-e .org$ -e .org_archive$ -e .org_done$'
4
5 cd ~;
6
7 emacsclient -n -e '(org-save-all-org-buffers)' >/dev/null 2>&1
8
9 for a in $(mr list |grep 'list:'|grep -v 'finished'|awk -F'list: ' '{print $2}' 2>/dev/null); do 
10     (cd "$a";
11     if git status --porcelain|grep '^ M'|grep -q $ORG_GREP; then
12           git commit -m'update org files' $(mr --no-recurse status |grep '^ M'|grep $ORG_GREP|sed 's/^ M//g');
13           if [ "$1" != "commit" ]; then
14               git push;
15           fi;
16        fi; 
17     );
18 done;