Skip to content

Commit

Permalink
Added warning message for todo.sh archive
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysle committed Dec 19, 2022
1 parent ea32af3 commit b9709c0
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions todo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1142,11 +1142,16 @@ case $action in
"archive" )
# defragment blank lines
sed -i.bak -e '/./!d' "$TODO_FILE"
[ "$TODOTXT_VERBOSE" -gt 0 ] && grep "^x " "$TODO_FILE"
grep "^x " "$TODO_FILE" >> "$DONE_FILE"
sed -i.bak '/^x /d' "$TODO_FILE"
if [ "$TODOTXT_VERBOSE" -gt 0 ]; then
echo "TODO: $TODO_FILE archived."
if grep "^x " "$TODO_FILE"; then
grep "^x " "$TODO_FILE" >> "$DONE_FILE"
sed -i.bak '/^x /d' "$TODO_FILE"
if [ "$TODOTXT_VERBOSE" -gt 0 ]; then
echo "TODO: $TODO_FILE archived."
fi
else
if [ "$TODOTXT_VERBOSE" -gt 0 ]; then
echo "TODO: $TODO_FILE does not contain any done tasks."
fi
fi
;;

Expand Down

0 comments on commit b9709c0

Please sign in to comment.