-
Notifications
You must be signed in to change notification settings - Fork 46
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
taskrc includes as relative paths cause FileNotFoundError in taskw #150
Comments
smemsh
added a commit
to smemsh/taskw
that referenced
this issue
Aug 29, 2021
Taskwarrior itself tries includes as absolute path, then cwd, then relative to rcfile, then in various search paths (see GothenburgBitFactory/libshared -> src/Configuration.cpp -> Configuration::parse()). We won't try to duplicate that whole arrangement here, but at least look relative to the rcfile in addition to cwd/absolute, like taskwarrior does. This will allow specification as relative path in most cases. Otherwise, we'd have to chdir anyways because includes are always tried as-is by taskw. They would only work if specified as absolute paths or if in cwd We use a TaskRc() class variable to store the rcdir because there could be an include chain and all the instances will need to know the same one, but will be processing different paths, so we have to capture the directory of the first one processed, ie the base rcfile. Fixes ralphbean#150
smemsh
added a commit
to smemsh/taskw
that referenced
this issue
Oct 10, 2021
Taskwarrior itself tries includes as absolute path, then cwd, then relative to rcfile, then in various search paths (see GothenburgBitFactory/libshared -> src/Configuration.cpp -> Configuration::parse()). We won't try to duplicate that whole arrangement here, but at least look relative to the rcfile in addition to cwd/absolute, like taskwarrior does. This will allow specification as relative path in most cases. Otherwise, we'd have to chdir anyways because includes are always tried as-is by taskw. They would only work if specified as absolute paths or if in cwd We use a TaskRc() class variable to store the rcdir because there could be an include chain and all the instances will need to know the same one, but will be processing different paths, so we have to capture the directory of the first one processed, ie the base rcfile. Fixes ralphbean#150
smemsh
added a commit
to smemsh/taskw
that referenced
this issue
May 7, 2022
Taskwarrior itself tries includes as absolute path, then cwd, then relative to rcfile, then in various search paths (see GothenburgBitFactory/libshared -> src/Configuration.cpp -> Configuration::parse()). We won't try to duplicate that whole arrangement here, but at least look relative to the rcfile in addition to cwd/absolute, like taskwarrior does. This will allow specification as relative path in most cases. Otherwise, we'd have to chdir anyways because includes are always tried as-is by taskw. They would only work if specified as absolute paths or if in cwd We use a TaskRc() class variable to store the rcdir because there could be an include chain and all the instances will need to know the same one, but will be processing different paths, so we have to capture the directory of the first one processed, ie the base rcfile. Fixes ralphbean#150
smemsh
added a commit
to smemsh/taskw
that referenced
this issue
Jun 18, 2022
Taskwarrior itself tries includes as absolute path, then cwd, then relative to rcfile, then in various search paths (see GothenburgBitFactory/libshared -> src/Configuration.cpp -> Configuration::parse()). We won't try to duplicate that whole arrangement here, but at least look relative to the rcfile in addition to cwd/absolute, like taskwarrior does. This will allow specification as relative path in most cases. Otherwise, we'd have to chdir anyways because includes are always tried as-is by taskw. They would only work if specified as absolute paths or if in cwd We use a TaskRc() class variable to store the rcdir because there could be an include chain and all the instances will need to know the same one, but will be processing different paths, so we have to capture the directory of the first one processed, ie the base rcfile. Fixes ralphbean#150
bergercookie
added a commit
to bergercookie/taskw-ng
that referenced
this issue
Jan 22, 2024
1. from the CWD (deprecated behavior in taskwarrior) 2. in $TASK_RCDIR (custom path - just to allow flexibility from the end-user side 3. relative to the TASKRC file 4. in `{/usr/,/usr/local/}/share/doc/task/rc/` This fixes the taskw repo bug ralphbean/taskw#150 . See also the relevant PR discussion in ralphbean/taskw#151
RaitoBezarius
added a commit
to RaitoBezarius/taskw
that referenced
this issue
Apr 1, 2024
Taskwarrior itself tries includes as absolute path, then cwd, then relative to rcfile, then in various search paths (see GothenburgBitFactory/libshared -> src/Configuration.cpp -> Configuration::parse()). We won't try to duplicate that whole arrangement here, but at least look relative to the rcfile in addition to cwd/absolute, like taskwarrior does. This will allow specification as relative path in most cases. Otherwise, we'd have to chdir anyways because includes are always tried as-is by taskw. They would only work if specified as absolute paths or if in cwd We use a TaskRc() class variable to store the rcdir because there could be an include chain and all the instances will need to know the same one, but will be processing different paths, so we have to capture the directory of the first one processed, ie the base rcfile. Fixes ralphbean#150 Co-authored-by: Raito Bezarius <masterancpp@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TaskWarrior config files can have
include
directives which are specified as paths relative to the location of the rcfile.taskw
library always tries to load the path as-is without searching for it using the algorithm that TaskWarrior does. This means it can only work withtaskw
if it is specified as absolute, or, if relative, the program happens to have its cwd in the.taskrc
location.Example .taskrc:
this will crash with FileNotFoundError exception in
taskw
:The text was updated successfully, but these errors were encountered: