Allow for placing addons in subfolders.

Addons can be placed in subfolders with the same name as the action,
in order to be able to e.g. clone git repos into the TODO_ACTIONS_DIR
rather than having to download addons and manage updates manually.

Closes #120
This commit is contained in:
nthorne
2013-11-22 23:20:55 +01:00
committed by Gina Trapani
parent 07b50a07e0
commit 7c92f46c25
4 changed files with 96 additions and 4 deletions

View File

@@ -16,3 +16,21 @@ echo "custom action $1"
EOF
chmod +x ".todo.actions.d/$1"
}
make_action_in_folder()
{
unset TODO_ACTIONS_DIR
[ -d .todo.actions.d ] || mkdir .todo.actions.d
mkdir .todo.actions.d/$1
cat > ".todo.actions.d/$1/$1" <<EOF
#!/bin/bash
[ "\$1" = "usage" ] && {
echo " $1 ITEM#[, ITEM#, ...] [TERM...]"
echo " This custom action does $1."
echo ""
exit
}
echo "custom action $1 in folder $1"
EOF
chmod +x ".todo.actions.d/$1/$1"
}