Simplified check for done task.
Use simple comparison with slice of string (already used e.g. in _list()) instead of grep -c pipeline. Closes #42
This commit is contained in:
committed by
Gina Trapani
parent
a60dfb668d
commit
b00ca1074a
2
todo.sh
2
todo.sh
@@ -954,7 +954,7 @@ case $action in
|
||||
[ -z "$todo" ] && die "TODO: No task $item."
|
||||
|
||||
# Check if this item has already been done
|
||||
if [ $(echo $todo | grep -c "^x ") -eq 0 ] ; then
|
||||
if [ "${todo:0:2}" != "x " ]; then
|
||||
now=$(date '+%Y-%m-%d')
|
||||
# remove priority once item is done
|
||||
sed -i.bak $item"s/^(.) //" "$TODO_FILE"
|
||||
|
||||
Reference in New Issue
Block a user