]> git.donarmstrong.com Git - bin.git/blobdiff - update_org_files
include archived files in org updates
[bin.git] / update_org_files
index b11a6618df265009991b0d59b789a539185c73ae..2d0244c3e4d863d04b80b78fa1b29deda2e75e08 100755 (executable)
@@ -1,12 +1,16 @@
 #!/bin/bash
 
+ORG_GREP='-e .org$ -e .org_archive$ -e .org_done$'
+
 cd ~;
 
 for a in $(mr list |grep 'list:'|grep -v 'finished'|awk -F'list: ' '{print $2}' 2>/dev/null); do 
     (cd "$a";
-    if mr --no-recurse status |grep '^ M'|grep -q '.org$'; then
-          git commit -m'update org files' $(mr --no-recurse status |grep '^ M'|grep '.org$'|sed 's/^ M//g');
-          git push;
+    if git status --porcelain|grep '^ M'|grep -q $ORG_GREP; then
+          git commit -m'update org files' $(mr --no-recurse status |grep '^ M'|grep $ORG_GREP|sed 's/^ M//g');
+          if [ "$1" != "commit" ]; then
+              git push;
+          fi;
        fi; 
     );
 done;