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

Ability to have pre/post hooks #224

Open
gms8994 opened this issue Aug 28, 2017 · 2 comments
Open

Ability to have pre/post hooks #224

gms8994 opened this issue Aug 28, 2017 · 2 comments
Milestone

Comments

@gms8994
Copy link

gms8994 commented Aug 28, 2017

I'd like the ability to have hooks that are triggered immediately before and after saving a new task (or updating an existing one, and possibly archiving one as well?). My use case for before saving a task is simple:

I want to be able to say t add This is a test task due:tomorrow, and have my pre-save hook look for due:tomorrow (or any other string I determine), and modify the task text before it gets written to todo.txt. Obviously, this only works for tasks added via todo.sh.

I'm willing to figure out how to do this myself, but if it's something the community doesn't want, I won't expend the energy :)

@karbassi karbassi added this to the Backlog milestone Oct 10, 2017
@betsythefc
Copy link

I think this can pretty easily be solved with an add-on. Say instead of typing in todo.sh add "NEW TASK", I could make an add-on that is todo.sh addf "NEW TASK due:tomorrow". I'm willing to write this if you'd like! I'll also take name suggestions as addf isn't very pretty looking.

Alternatively this could be made to work outside of todo.sh if you wanted to be creative by setting TOMORROW as a variable, and using that instead, so bash (or whatever shell) expands it before being written. Not sure how you'd keep the variable up to date, but that's just one other option.

@betsythefc
Copy link

https://github.com/betsythefc/add

@gms8994, I made this add-on, it replaces add. I think this should be done with the script and not an add-on longterm but I don't know the right way to implement (I am working on it).

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

No branches or pull requests

3 participants