Created
May 31, 2012 13:08
-
-
Save pfsmorigo/2843323 to your computer and use it in GitHub Desktop.
tasknote
This file contains 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
#!/bin/bash | |
EDITOR=vim | |
TASKBIN=task | |
FOLDER="${HOME}/Dropbox/tasknotes/" | |
EXT=".wiki" | |
# Display usage if task number not supplied on cli | |
if [ "$1" = "" ]; then | |
echo "Usage: $(basename $0) <id>" | |
exit 1 | |
fi | |
#find UUID from given task | |
uuid=$($TASKBIN "$*" uuid) | |
if [ -z $uuid ]; then | |
echo "Task \"$*\" not found..." | |
exit 1 | |
fi | |
# build full path & file name to store notes in | |
file="$FOLDER$uuid$EXT" | |
#create/edit $file with editor | |
$SHELL -c "$EDITOR $file" | |
# Add or remove the note tag | |
if [ -f $file ]; then | |
$SHELL -c "$TASKBIN $* mod +note" | |
else | |
$SHELL -c "$TASKBIN $* mod -note" | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment