mirror of
https://github.com/DCsunset/taskwarrior-webui.git
synced 2025-08-18 21:43:06 +02:00
Allow overriding TASKRC/TASKDATA using environment variables
This commit is contained in:
parent
1d79a90ffb
commit
35a5363628
2 changed files with 9 additions and 4 deletions
|
@ -64,6 +64,12 @@ Then install nginx or other web servers
|
|||
to server frontend and proxy requests to backend
|
||||
(you can refer to `nginx/nginx.conf`).
|
||||
|
||||
### Configuration
|
||||
|
||||
The following environment variable may be set:
|
||||
* `TASKRC` - the location of the `.taskrc` file, `/.taskrc` by default when run in _production_ mode
|
||||
* `TASKDATA` - the location of the `.task` directory, `/.task` by default when run in _production_ mode
|
||||
|
||||
|
||||
## Development
|
||||
|
||||
|
|
|
@ -2,10 +2,9 @@ import { TaskwarriorLib } from 'taskwarrior-lib';
|
|||
import * as path from 'path';
|
||||
|
||||
const prod = process.env.NODE_ENV === 'production';
|
||||
const taskRc = process.env.TASKRC || (prod ? '/.taskrc' : path.join(__dirname, '../test/.taskrc'));
|
||||
const taskData = process.env.TASKDATA || (prod ? '/.task' : path.join(__dirname, '../test/.task'));
|
||||
|
||||
const taskwarrior = new TaskwarriorLib(
|
||||
prod ? '/.taskrc' : path.join(__dirname, '../test/.taskrc'),
|
||||
prod ? '/.task' : path.join(__dirname, '../test/.task'),
|
||||
);
|
||||
const taskwarrior = new TaskwarriorLib(taskRc, taskData);
|
||||
|
||||
export default taskwarrior;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue