Skip to content

Instantly share code, notes, and snippets.

@mence
Created June 29, 2016 15:57
Show Gist options
  • Select an option

  • Save mence/fbbdebae092a6616001f44773385dc9c to your computer and use it in GitHub Desktop.

Select an option

Save mence/fbbdebae092a6616001f44773385dc9c to your computer and use it in GitHub Desktop.
todo-txt: todo.sh --> Add didit-cli-client shell call to do function
"do" )
errmsg="usage: $TODO_SH do ITEM#[, ITEM#, ITEM#, ...]"
# shift so we get arguments to the do request
shift;
[ "$#" -eq 0 ] && die "$errmsg"
# Split multiple do's, if comma separated change to whitespace separated
# Loop the 'do' function for each item
for item in ${*//,/ }; do
getTodo "$item"
# Check if this item has already been done
if [ "${todo:0:2}" != "x " ]; then
now=$(date '+%Y-%m-%d')
# remove priority once item is done
sed -i.bak $item"s/^(.) //" "$TODO_FILE"
sed -i.bak $item"s|^|x $now |" "$TODO_FILE"
if [ $TODOTXT_VERBOSE -gt 0 ]; then
getNewtodo "$item"
echo "$item $newtodo"
echo "TODO: $item marked as done."
didit.rb "$newtodo" # TIM: ADDED DIDIT-CLI-CLIENT INTEGRATION
fi
else
echo "TODO: $item is already marked done."
fi
done
if [ $TODOTXT_AUTO_ARCHIVE = 1 ]; then
# Recursively invoke the script to allow overriding of the archive
# action.
"$TODO_FULL_SH" archive
fi
;;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment