You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are various special variables available but none of them reflects the working directory of a respective task. The ones that come closest are:
USER_WORKING_DIR which contains the directory where task has been called from, but does not honor the -d <dir> command line parameter
and
TASK_DIR which merely contains what has been configured under dir: in a task of the Taskfile.yml file and does not even resolve template expressions.
I see two different solutions to this problem:
Either change the behavior of USER_WORKING_DIR so that it takes the -d parameter into account, because I see only very little benefit in having a variable which contains the directory where task has been called from when a different working directory has been explicitly set with -d
Introduce a new variable such as TASK_WORKING_DIR which contains the desired dir and does not break the current behavior of USER_WORKING_DIR.
The current use case which I have is as follows: I have a root directory containing a Taskfile.yml file and some subdirectories which doesnt have Taskfiles.yml files. I now want to reuse the logic of the Taskfile.yml from the root directory in the subdirectories as described here. This works well if I navigate to a subdirectory and call the respective task from there, however, when I call task from the root directory and specify the subdirectory with the -d parameter it doesnt work as USER_WORKING_DIR still contains the root directory as outlined above.
The text was updated successfully, but these errors were encountered:
Description
There are various special variables available but none of them reflects the working directory of a respective task. The ones that come closest are:
USER_WORKING_DIR
which contains the directory where task has been called from, but does not honor the-d <dir>
command line parameterand
TASK_DIR
which merely contains what has been configured underdir:
in a task of theTaskfile.yml
file and does not even resolve template expressions.I see two different solutions to this problem:
USER_WORKING_DIR
so that it takes the-d
parameter into account, because I see only very little benefit in having a variable which contains the directory where task has been called from when a different working directory has been explicitly set with-d
TASK_WORKING_DIR
which contains the desired dir and does not break the current behavior ofUSER_WORKING_DIR
.The current use case which I have is as follows: I have a root directory containing a
Taskfile.yml
file and some subdirectories which doesnt haveTaskfiles.yml
files. I now want to reuse the logic of theTaskfile.yml
from the root directory in the subdirectories as described here. This works well if I navigate to a subdirectory and call the respective task from there, however, when I call task from the root directory and specify the subdirectory with the-d
parameter it doesnt work asUSER_WORKING_DIR
still contains the root directory as outlined above.The text was updated successfully, but these errors were encountered: