tbabej / taskpirate

A pluggable system for tasklib based TaskWarrior hooks. Faster, less boilerplate code!
Other
46 stars 10 forks source link

Hook Error: Expected feedback from failing hook script (when using $XDG) #16

Closed kaushikgopal closed 3 years ago

kaushikgopal commented 3 years ago

I'm actually not entirely sure this is a task pirate issue (could actually just be a hooks + taskwarrior in general problem), but starting with an issue here, will move over to the right tool if folks have more input.

I recently moved to using XDG based directory structure for task warrior. I did this after upgrading to 2.6.1.

I notice this error happens only after one of my hooks (in this case the shift recurrence one) attempt to execute.

CleanShot 2021-10-25 at 11 33 34@2x

Some noteworthy environment variables:

task --version # 2.6.1

set --export XDG_CONFIG_HOME $HOME/.config
set --export XDG_DATA_HOME $HOME/.data

data.location=$XDG_DATA_HOME/task/
hooks.location=$XDG_CONFIG_HOME/task/hooks/

Another peculiar observation is that there were .data files being created in my ~/.config/task/ directory

CleanShot 2021-10-25 at 11 41 18@2x

Let me know if I can provide any more information or if I should instead open these in the main taskwarrior project.

tbabej commented 3 years ago

@kaushikgopal I think the problem here is that you're tasklib version is slightly out of date. For support for 2.6.0 or higher, you need to upgrade to tasklib 2.4, ideally the latest 2.4.3 release using pip.

tbabej commented 3 years ago

Note that XDG settings should be unrelated to this. The problem under the hood is slight CLI semantics change for task export command that happened in 2.6. and on which previous versions of tasklib unfortunately relied upon.

kaushikgopal commented 3 years ago

ahh.. that might be it. interestingly, my setup script had this for installation:

pip3 install --user git+git://github.com/tbabej/tasklib@develop

I think I used your version of tasklib (maybe for taskwiki at some point?) and assumed it was the latest version. I'll upgrade to the latest tasklib version and confirm.

tbabej commented 3 years ago

Got it. Those were indeed the official instructions at some point (when the official tasklib was not maintained frequently enough for me to be able to get my improvements in). Since then, several releases have been made, and the tasklib project was transferred over to GothenburgBitFactory org, so now I can make releases as well, ensuring the things are properly up to date.

TL;DR: That line can be replaced by just using the official tasklib release on PYPI :slightly_smiling_face: