]> gitweb.fluxo.info Git - scripts.git/commitdiff
Check for mr and folders
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 16 Sep 2017 21:30:56 +0000 (18:30 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 16 Sep 2017 21:30:56 +0000 (18:30 -0300)
status
todo

diff --git a/status b/status
index f40980fab38f4337d6944435499284ce24eabc16..e042968efc63efe5867b2236e08e6d9ad591a76e 100755 (executable)
--- a/status
+++ b/status
@@ -77,7 +77,9 @@ function status_run {
 
     # Update your mrconfig and check all registered repositories
     # Pipe through cat so we don't have to deal with mr's dynamic output weirdness
-    mrconfig-updater && mr -m status | cat
+    if which mr &> /dev/null; then
+      mrconfig-updater && mr -m status | cat
+    fi
 
     # Check your TODO lists
     todo
diff --git a/todo b/todo
index bc49459bc92ede98ca43b1c845234cb9703b0b25..a4589c76ced2ac13152495d9b4c8fb69652a1ffb 100755 (executable)
--- a/todo
+++ b/todo
@@ -22,6 +22,10 @@ FOLDERS="`echo $WORKPATH | tr ':' ' ' | sed -e "s|~|$HOME|g"`"
 # Iterate
 function todo_find {
   for folder in $FOLDERS; do
+    if [ ! -d "$folder" ]; then
+      continue
+    fi
+
     find $folder/ -maxdepth $TODO_MAXDEPTH -xtype f -iname 'todo*' | while read todo; do
       # Ignore lists without tasks
       if grep -q -e '*' -e '-' $todo; then