refactor: improve bots/todo-* (#41)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
name: Todo List
|
||||
name: TodoBot
|
||||
description: Your name is TodoBot and you are a helpful chatbot that manages a todo list.
|
||||
instructions: |
|
||||
You will be provided with a list of todos.
|
||||
|
||||
@@ -31,7 +31,7 @@ del_todo() {
|
||||
> "$todos_file"
|
||||
echo "Successfully deleted todo id=$argc_id"
|
||||
else
|
||||
_die "Empty todo list"
|
||||
echo "Empty todo list"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ list_todos() {
|
||||
if [[ -f "$todos_file" ]]; then
|
||||
cat "$todos_file"
|
||||
else
|
||||
_die "Empty todo list"
|
||||
echo '[]'
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -63,10 +63,5 @@ _get_todos_file() {
|
||||
echo "${LLM_BOT_CACHE_DIR:-/tmp}/todos.json"
|
||||
}
|
||||
|
||||
_die() {
|
||||
echo "$*" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# See more details at https://github.com/sigoden/argc
|
||||
eval "$(argc --argc-eval "$0" "$@")"
|
||||
|
||||
Reference in New Issue
Block a user