Dynamic variables of included taskfiles evaluated twice #2641
gkuhlmann-arine
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Before creating an issue, I wanted to discuss if it is intended or necessary behavior.
Summary
When including another taskfile, the dynamic variables of the included taskfile appear to be evaluated twice:
TASKFILE_DIRvalue (the parent's)TASKFILE_DIRvalue (the child's)To reproduce
Successful case
Without changing any code above:
# from parent folder task --verboseOutput:
Note that
MY_TASKFILE_DIRis evaluated first with the "wrong" value and a second time with the "correct" value.Failing case
Uncomment the
ASSERT_CHILD_TASKFILEline inchild/Taskfile.yml# from parent folder task --verboseOutput:
Why this is a problem
As the failing case shows, this double-evaluation relies on the first evaluation not failing. However, in a real use case, the script we run for a dynamic variable may only succeed for the "correct" value of
TASKFILE_DIR, e.g.Discussion
TASKFILE_DIRis "wrong"?Beta Was this translation helpful? Give feedback.
All reactions