mirror of
https://github.com/go-task/task.git
synced 2026-06-27 06:34:18 +00:00
fix(compiler): add call.Vars support in scoped mode
When calling a task with vars (e.g., `task: name` with `vars:`), those vars were not being applied in scoped mode. This fix adds call.Vars to the variable resolution chain. Variable priority (lowest to highest): 1. Root Taskfile vars 2. Include Taskfile vars 3. Include passthrough vars 4. Task vars 5. Call vars (NEW) 6. CLI vars
This commit is contained in:
@@ -1272,5 +1272,14 @@ func TestScopedTaskfiles(t *testing.T) {
|
||||
),
|
||||
WithTask("a:print-env"),
|
||||
)
|
||||
// Test call vars: vars passed when calling a task override task vars
|
||||
NewExecutorTest(t,
|
||||
WithName("call-vars"),
|
||||
WithExecutorOptions(
|
||||
task.WithDir("testdata/scoped_taskfiles"),
|
||||
task.WithSilent(true),
|
||||
),
|
||||
WithTask("call-with-vars"),
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user