Skip to content

Custom actions will not work if a custom $TODO_DIR is used #292

@Matze1224

Description

@Matze1224

Do you want to request a feature or report a bug?
A bug, but you may see it as a feature.

What is the current behavior?
Using todo.txt with the debian packaging distribution, the folder is ~/.todo-txt. When using custom actions, there also contained in this folder. I can't be executed.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

  1. Install todo.txt as debian package
  2. Create some custom action, may even only echos "Hello World"
  3. Try to execute this custom action with todo-txt

What is the expected behavior?
To run the custom action without relinking the folder .todo-txt or some other quick fix.

The problem in the code:
This is the hot spot:

if [ -z "$TODO_ACTIONS_DIR" ] || [ ! -d "$TODO_ACTIONS_DIR" ]
then
    TODO_ACTIONS_DIR="$HOME/.todo/actions"
    export TODO_ACTIONS_DIR
fi

The todo directory is hardcoded, so there is no chance to use the custom directory defined by the packaging author. To make this more adaptable, It would better to use the already existing variable $TODO_DIR (I think so).

Which versions todo.sh are you using?

Run todo.sh -V
TODO.TXT Command Line Interface v2.11.0

Which Operating System are you using?
Debian bullseye/testing

Which version of bash are you using?

Run bash --version
GNU bash, Version 5.0.11(1)-release (x86_64-pc-linux-gnu)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions