]> git.donarmstrong.com Git - bin.git/blob - update_org_files
add reset usb bus command
[bin.git] / update_org_files
1 #!/bin/bash
2
3 ORG_GREP='-e .org$ -e .org_archive$ -e .org_done$'
4
5 COMMIT_MESSAGE="${1:-update org files}"
6
7 if [ "x$UPDATE_ORG_REALLY_DO_IT" == "xyesdoit" ]; then
8     if git status --porcelain -z | grep -z '^ M' | grep -zq $ORG_GREP; then
9         git status --porcelain -z | grep -z '^ M' | grep -z $ORG_GREP | \
10             sed -z 's/^ M[[:space:]]*//g' | \
11             xargs -0 git commit -m"$COMMIT_MESSAGE"
12         git pull --rebase;
13         git push;
14     else
15         git pull --rebase;
16     fi;
17 else
18     if [ "x$NO_SAVE_ORG_BUFFERS" == "x" ]; then
19         emacsclient -n -e '(org-save-all-org-buffers)' >/dev/null 2>&1
20     fi;
21     UPDATE_ORG_REALLY_DO_IT="yesdoit" mr -d ~/projects/org-notes -j5 run \
22                            update_org_files "$COMMIT_MESSAGE"
23     UPDATE_ORG_REALLY_DO_IT="yesdoit" mr -d ~/org-mode -j5 run \
24                            update_org_files "$COMMIT_MESSAGE";
25 fi;