]> git.donarmstrong.com Git - bin.git/blob - update_org_files
b50ff08f7f78d2f44fe298cfbbb401ac0b64f5b9
[bin.git] / update_org_files
1 #!/bin/bash
2
3 ORG_GREP='-e .org$ -e .org_archive$ -e .org_done$'
4
5 if [ "x$1" == "xdoit" ]; then
6     if git status --porcelain|grep '^ M'|grep -q $ORG_GREP; then
7         git commit -m'update org files' $(mr --no-recurse status |grep '^ M'|grep $ORG_GREP|sed 's/^ M//g');
8         if [ "$2" != "commit" ]; then
9             git push;
10         fi;
11     fi; 
12 else
13     emacsclient -n -e '(org-save-all-org-buffers)' >/dev/null 2>&1
14     mr -d ~ -j5 run update_org_files doit;
15 fi;
16
17