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
In my project I'd like to have a file with shared tasks (Tasklib.yaml) included in the Taskfiles of subdirectories. I then want to include the subdirectory Taskfiles in my root directory Taskfile. The project structure looks like this:
version: '3'includes:
shared:
taskfile: ../Tasklib.yamlflatten: truetasks:
subdir-test: ls ; echo
When I run task -a, this is the output:
❯ task -a
task: Available tasks for this project:
* test:
* shared:shared-test:
* subdir:shared-test:
* subdir:subdir-test:
When I run all of the tasks, subdir:shared-test gives a different output, despite running from the same folder and not having the dir property set in the include.
task test; task shared:shared-test ; task subdir:shared-test ; task subdir:subdir-test
task: [test] ls ;echo
Taskfile.yaml Tasklib.yaml subdir
task: [shared:shared-test] ls ;echo
Taskfile.yaml Tasklib.yaml subdir
task: [subdir:shared-test] ls ;echo
Taskfile.yaml
task: [subdir:subdir-test] ls ;echo
Taskfile.yaml Tasklib.yaml subdir
I'd expect these all to have the same output based on what the documentation states about the execution directory, but I guess having this circular include leads to a different output for the shared task when included from the subdirectory's Taskfile. Sorry if this has been posted before, but I couldn't identify an issue with this exact problem laid out. Please let me know if this is intended or not. Thank you!
Task version: 3.39.2
Operating system: macOS Sonoma 14.6.1
Experiments enabled: false
The text was updated successfully, but these errors were encountered:
In my project I'd like to have a file with shared tasks (
Tasklib.yaml
) included in the Taskfiles of subdirectories. I then want to include the subdirectory Taskfiles in my root directory Taskfile. The project structure looks like this:The root
Taskfile.yaml
looks like this:The shared tasks
Tasklib.yaml
looks like this:The subdirectory
Taskfile.yaml
looks like this:When I run
task -a
, this is the output:When I run all of the tasks,
subdir:shared-test
gives a different output, despite running from the same folder and not having thedir
property set in the include.I'd expect these all to have the same output based on what the documentation states about the execution directory, but I guess having this circular include leads to a different output for the shared task when included from the subdirectory's Taskfile. Sorry if this has been posted before, but I couldn't identify an issue with this exact problem laid out. Please let me know if this is intended or not. Thank you!
The text was updated successfully, but these errors were encountered: