]> git.donarmstrong.com Git - bin.git/blob - update_org_files
add git-hogs command
[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 -z | grep -z '^ M' | grep -zq $ORG_GREP; then
7         git status --porcelain -z | grep -z '^ M' | grep -z $ORG_GREP | \
8             sed -z 's/^ M[[:space:]]*//g' | \
9             xargs -0 git commit -m'update org files'
10         git push;
11     fi;
12     git pull;
13 else
14     emacsclient -n -e '(org-save-all-org-buffers)' >/dev/null 2>&1
15     mr -d ~/projects/org-notes -j5 run update_org_files doit;
16     mr -d ~/org-mode -j5 run update_org_files doit;
17 fi;