conditionally define t()

if user has installed the todo plugin, forego defining the 'one thing'
todo function t().
pull/129/head^2
Erich Smith 2012-05-17 21:40:08 -04:00
parent 57283d72de
commit dd9fb1009b
1 changed files with 15 additions and 0 deletions

View File

@ -137,6 +137,21 @@ usage ()
fi fi
} }
if [ ! -e $BASH_IT/plugins/enabled/todo.plugin.bash ]; then
# if user has installed todo plugin, skip this...
t ()
{
about 'one thing todo'
param 'if not set, display todo item'
param '1: todo text'
if [[ "$*" == "" ]] ; then
cat ~/.t
else
echo "$*" > ~/.t
fi
}
fi
command_exists () command_exists ()
{ {
about checks for existence of a command about checks for existence of a command