task
task copied to clipboard
Ensure that `TASK_TEMP_DIR` is considered if set on the `.env` file
Actually the task temp dir is configurable only by setting an env variable (TASK_TEMP_DIR) on the machine,
but this is a bit in contrast with this assertion in the documentation:
Most of the time, you'll want to have this directory on .gitignore (or equivalent) so it isn't committed.
Clearly is not possible to predict the value of the env var, so my proposal is to move this configuration on the Taskfile or maybe some other versionable stuff.
The directory is always .task, unless changed by env, so you need to add .task/**/* to .gitignore. Will such solution not work?
Oh I think I understand, but afaik the env var should not be unpredictable. It's not unpredictable in a sense that it's random, you can set it and you can include the appropriate .gitignore line no?
I agree that there should be a possibility to configure temporary directory in the taskfile itself. I tend to collect all temp files of the project in a single project directory so that I don't pollute my root directory with to many useless files. And I want to force that for all users of my project, that's why env variable does not solve the issue.
One way to support this that is more in line with our current conventions is to read this variable from the .env file, so that could be committed and every user would have the same values (unless overwritten).
Thank you! By the way, if I set TASK_TEMP_DIR=/tmp/.task globally on my machine, then tasks with same names from different projects will share checksums, right?
One way to support this that is more in line with our current conventions is to read this variable from the .env file, so that could be committed and every user would have the same values (unless overwritten).
Does it mean that simply setting env: { TASK_TEMP_DIR: XXX } without a .env file will also work?