Skip to content

Instantly share code, notes, and snippets.

@pfsmorigo
Created May 31, 2012 13:08
Show Gist options
  • Save pfsmorigo/2843323 to your computer and use it in GitHub Desktop.
Save pfsmorigo/2843323 to your computer and use it in GitHub Desktop.
tasknote
#!/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