Merge git://github.com/ginatrapani/todo.txt-cli into addons

This commit is contained in:
Gina Trapani
2009-04-06 12:37:31 -07:00
2 changed files with 13 additions and 4 deletions

View File

@@ -10,6 +10,9 @@ export DONE_FILE="$TODO_DIR/done.txt"
export REPORT_FILE="$TODO_DIR/report.txt" export REPORT_FILE="$TODO_DIR/report.txt"
export TMP_FILE="$TODO_DIR/todo.tmp" export TMP_FILE="$TODO_DIR/todo.tmp"
# You can customize your actions directory location
#export TODO_ACTIONS_DIR="$HOME/.todo.actions.d"
# == EDIT FILE LOCATIONS ABOVE === # == EDIT FILE LOCATIONS ABOVE ===
# === COLOR MAP === # === COLOR MAP ===

14
todo.sh
View File

@@ -206,10 +206,10 @@ help()
TODOTXT_SORT_COMMAND="sort ..." customize list output TODOTXT_SORT_COMMAND="sort ..." customize list output
EndHelp EndHelp
if [ -d "$HOME/.todo.actions.d" ] if [ -d "$TODO_ACTIONS_DIR" ]
then then
echo "" echo ""
for action in $HOME/.todo.actions.d/* for action in "$TODO_ACTIONS_DIR/*"
do do
if [ -x $action ] if [ -x $action ]
then then
@@ -355,6 +355,12 @@ TODOTXT_SORT_COMMAND=${TODOTXT_SORT_COMMAND:-env LC_COLLATE=C sort -f -k2}
export TODOTXT_VERBOSE TODOTXT_PLAIN TODOTXT_CFG_FILE TODOTXT_FORCE TODOTXT_PRESERVE_LINE_NUMBERS TODOTXT_AUTO_ARCHIVE TODOTXT_DATE_ON_ADD TODOTXT_SORT_COMMAND export TODOTXT_VERBOSE TODOTXT_PLAIN TODOTXT_CFG_FILE TODOTXT_FORCE TODOTXT_PRESERVE_LINE_NUMBERS TODOTXT_AUTO_ARCHIVE TODOTXT_DATE_ON_ADD TODOTXT_SORT_COMMAND
if [ -z "$TODO_ACTIONS_DIR" -o ! -d "$TODO_ACTIONS_DIR" ]
then
TODO_ACTIONS_DIR="$HOME/.todo.actions.d"
export TODO_ACTIONS_DIR
fi
TODO_SH="$0" TODO_SH="$0"
export TODO_SH export TODO_SH
@@ -507,9 +513,9 @@ then
shift shift
## Reset action to new first argument ## Reset action to new first argument
action=$( printf "%s\n" "$1" | tr 'A-Z' 'a-z' ) action=$( printf "%s\n" "$1" | tr 'A-Z' 'a-z' )
elif [ -d "$HOME/.todo.actions.d" -a -x "$HOME/.todo.actions.d/$action" ] elif [ -d "$TODO_ACTIONS_DIR" -a -x "$TODO_ACTIONS_DIR/$action" ]
then then
"$HOME/.todo.actions.d/$action" "$@" "$TODO_ACTIONS_DIR/$action" "$@"
cleanup cleanup
fi fi