diff --git a/task.go b/task.go index abb09db9..3f384465 100644 --- a/task.go +++ b/task.go @@ -98,7 +98,7 @@ func (e *Executor) Run(args ...string) error { } for _, a := range args { - if err := e.RunTask(context.Background(), Call{Task: a}); err != nil { + if err := e.RunTask(context.Background(), Call{Task: a, Vars: e.taskvars}); err != nil { return err } } diff --git a/task_test.go b/task_test.go index e75ea8d4..df37ed27 100644 --- a/task_test.go +++ b/task_test.go @@ -236,6 +236,7 @@ func TestParams(t *testing.T) { {"dep2.txt", "Dependence2\n"}, {"spanish.txt", "¡Holla mundo!\n"}, {"spanish-dep.txt", "¡Holla dependencia!\n"}, + {"portuguese.txt", "Olá, mundo!\n"}, } for _, f := range files { diff --git a/testdata/params/Taskfile.yml b/testdata/params/Taskfile.yml index ddc11925..d2c9c6fc 100644 --- a/testdata/params/Taskfile.yml +++ b/testdata/params/Taskfile.yml @@ -1,6 +1,7 @@ default: vars: SPANISH: ¡Holla mundo! + PORTUGUESE: "{{.PORTUGUESE}}" deps: - task: write-file vars: {CONTENT: Dependence1, FILE: dep1.txt} @@ -17,6 +18,8 @@ default: vars: {CONTENT: "!", FILE: exclamation.txt} - task: write-file vars: {CONTENT: "{{.SPANISH}}", FILE: spanish.txt} + - task: write-file + vars: {CONTENT: "{{.PORTUGUESE}}", FILE: portuguese.txt} write-file: cmds: diff --git a/testdata/params/Taskvars.yml b/testdata/params/Taskvars.yml new file mode 100644 index 00000000..7da530f1 --- /dev/null +++ b/testdata/params/Taskvars.yml @@ -0,0 +1 @@ +PORTUGUESE: Olá, mundo!