Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Matze1224 opened this issue Feb 2, 2020 · 3 comments
Open

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

Matze1224 opened this issue Feb 2, 2020 · 3 comments

Comments

@Matze1224
Copy link

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)

@inkarkat
Copy link
Member

inkarkat commented Feb 2, 2020

You're right. So far, you would need to override the action dir location via TODO_ACTIONS_DIR as well. By defaulting to $TODO_DIR instead of hard-coding ~/.todo, this could be avoided. I don't see any downsides here, but it's one pitfall less. Goes into the same direction as #289.

@chrysle
Copy link
Contributor

chrysle commented Mar 6, 2023

@inkarkat Is this a change which could be introduced before backlog has been cleaned?

@inkarkat
Copy link
Member

inkarkat commented Mar 6, 2023

@chrysle There's little risk of merge conflicts in that area, yes. But to be honest our top priority has to be clearing the backlog of outstanding PRs, and anything that's blocking that (for example, the failing MacOS tests).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants