Skip to content

Commit 5ece1d7

Browse files
committed
fix Taskvars.yml vars not available while interpolating vars prop
closes #40
1 parent ac7ab42 commit 5ece1d7

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

task.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func (e *Executor) Run(args ...string) error {
9898
}
9999

100100
for _, a := range args {
101-
if err := e.RunTask(context.Background(), Call{Task: a}); err != nil {
101+
if err := e.RunTask(context.Background(), Call{Task: a, Vars: e.taskvars}); err != nil {
102102
return err
103103
}
104104
}

task_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ func TestParams(t *testing.T) {
236236
{"dep2.txt", "Dependence2\n"},
237237
{"spanish.txt", "¡Holla mundo!\n"},
238238
{"spanish-dep.txt", "¡Holla dependencia!\n"},
239+
{"portuguese.txt", "Olá, mundo!\n"},
239240
}
240241

241242
for _, f := range files {

testdata/params/Taskfile.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
default:
22
vars:
33
SPANISH: ¡Holla mundo!
4+
PORTUGUESE: "{{.PORTUGUESE}}"
45
deps:
56
- task: write-file
67
vars: {CONTENT: Dependence1, FILE: dep1.txt}
@@ -17,6 +18,8 @@ default:
1718
vars: {CONTENT: "!", FILE: exclamation.txt}
1819
- task: write-file
1920
vars: {CONTENT: "{{.SPANISH}}", FILE: spanish.txt}
21+
- task: write-file
22+
vars: {CONTENT: "{{.PORTUGUESE}}", FILE: portuguese.txt}
2023

2124
write-file:
2225
cmds:

testdata/params/Taskvars.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PORTUGUESE: Olá, mundo!

0 commit comments

Comments
 (0)