Taskwarrior: [TW-1745] Allow for use of environment variables in config file

Created on 14 Feb 2018  路  4Comments  路  Source: GothenburgBitFactory/taskwarrior

_Alan Young on 2015-12-30T17:20:56Z says:_

The specific example I want to use is, in the .taskrc file:

include data.location/include/file_to.include

where data.location is replaced with the value of the config option data.location.

enhancement

Most helpful comment

Just adding some comments related to what the last guy (directly above me) said:

Simply "using" or reading environment variables in .taskrc is also something I'd be interested in...

Specific use-case:

I have TASKRC in my environment pointed to "$XDG_CONFIG_HOME"/taskrc and inside my taskrc I would like to set data.location to "$XDG_DATA_HOME/task".

All 4 comments

Migrated metadata:

Created: 2015-12-30T17:20:56Z
Modified: 2017-01-16T18:29:11Z

_Paul Beckingham on 2017-01-16T18:29:11Z says:_

Change title to add 'environment' which might be more useful.

Just adding some comments related to what the last guy (directly above me) said:

Simply "using" or reading environment variables in .taskrc is also something I'd be interested in...

Specific use-case:

I have TASKRC in my environment pointed to "$XDG_CONFIG_HOME"/taskrc and inside my taskrc I would like to set data.location to "$XDG_DATA_HOME/task".

Another use case: I would like to be able to read environment variables for configuring certificate, key, and ca paths for taskd syncing.

Example, as of version 2.5.1, this does not currently work:

taskd.certificate=$XDG_DATA_HOME/task/taskd.cert.pem
taskd.key=$XDG_DATA_HOME/task/taskd.key.pem
taskd.ca=$XDG_DATA_HOME/task/taskd.ca.pem

But taskwarrior does understand ~ means $HOME so as a workaround this does work:

taskd.certificate=~/.local/share/task/taskd.cert.pem
taskd.key=~/.local/share/task/taskd.key.pem
taskd.ca=~/.local/share/task/taskd.ca.pem
Was this page helpful?
0 / 5 - 0 ratings