Closed khaeru closed 9 years ago
Hm, since taskw is a library.. I'm not sure it should be responsible for checking environment variables. Should taskwarrior-time-tracking-hook do this instead and pass the value to taskw? @kostajh, do you have an opinion on this?
Hrm -- I hadn't realized that that environment variable could be used to point at one's Taskrc file. Given that we already automatically calculate where one's Taskrc file is in taskw, though, I think it might make the most sense to do this calculation in taskw. Even better: if it's possible for us to ask taskwarrior where it will be reading its config from, we could use that path?
On Tue, Feb 24, 2015 at 12:19 PM, Ralph Bean notifications@github.com wrote:
Hm, since taskw is a library.. I'm not sure it should be responsible for checking environment variables. Should taskwarrior-time-tracking-hook do this instead and pass the value to taskw? @kostajh https://github.com/kostajh, do you have an opinion on this?
— Reply to this email directly or view it on GitHub https://github.com/ralphbean/taskw/issues/94#issuecomment-75837209.
This could be as simple as replacing "~/.taskrc"
with os.getenv('TASKRC', '~/.taskrc')
. Since the former appears in multiple places, perhaps set a global variable near the top of warrior.py:
TASKRC = os.getenv('TASKRC', '~/.taskrc')
…if that's consistent with your coding style.
Sure. Want to submit the pull-request @khaeru?
I have set the TASKRC environment variable to set a custom location for the taskwarrior configuration file:
I installed the taskwarrior-time-tracking-hook by @kostajh, but it fails because taskw does not check this environment variable and instead looks for the configuration file at ~/.taskrc: