From dfaa5f76d8a29679da9f14d7bf3078ce2ac6046b Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 20 Oct 2016 10:11:50 -0200 Subject: TODO: Ignore lists without tasks --- todo | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/todo b/todo index 7f2a4e4..1671485 100755 --- a/todo +++ b/todo @@ -22,7 +22,12 @@ FOLDERS="`echo $WORKPATH | tr ':' ' ' | sed -e "s|~|$HOME|g"`" # Iterate function todo_find { for folder in $FOLDERS; do - find $folder/ -maxdepth $TODO_MAXDEPTH -xtype f -iname 'todo*' + find $folder/ -maxdepth $TODO_MAXDEPTH -xtype f -iname 'todo*' | while read todo; do + # Ignore lists without tasks + if grep -q -e '*' -e '-' $todo; then + echo $todo + fi + done done } -- cgit v1.2.3