Created
June 29, 2016 15:57
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "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