1
0
mirror of https://github.com/go-task/task.git synced 2024-12-12 10:45:49 +02:00

fix: variables passed to included taskfile (#1533)

This commit is contained in:
Pete Davison 2024-03-10 17:28:04 +00:00 committed by GitHub
parent a425e2bb6c
commit c0a0faf3d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View File

@ -129,10 +129,10 @@ func (c *Compiler) getVariables(t *ast.Task, call *ast.Call, evaluateShVars bool
return nil, err return nil, err
} }
if t != nil { if t != nil {
if err := t.IncludedTaskfileVars.Range(taskRangeFunc); err != nil { if err := t.IncludeVars.Range(rangeFunc); err != nil {
return nil, err return nil, err
} }
if err := t.IncludeVars.Range(rangeFunc); err != nil { if err := t.IncludedTaskfileVars.Range(taskRangeFunc); err != nil {
return nil, err return nil, err
} }
} }

View File

@ -1785,7 +1785,7 @@ Hello bar
`) `)
require.NoError(t, e.Run(context.Background(), &ast.Call{Task: "default"})) require.NoError(t, e.Run(context.Background(), &ast.Call{Task: "default"}))
t.Log(buff.String()) t.Log(buff.String())
assert.Equal(t, strings.TrimSpace(buff.String()), expectedOutputOrder) assert.Equal(t, expectedOutputOrder, strings.TrimSpace(buff.String()))
} }
func TestErrorCode(t *testing.T) { func TestErrorCode(t *testing.T) {

View File

@ -1,7 +1,7 @@
version: "3" version: "3"
vars: vars:
RECEIVER: "world" RECEIVER: '{{ .RECEIVER | default "world" }}'
tasks: tasks:
greet: greet: