1
0
mirror of https://github.com/go-task/task.git synced 2025-02-09 13:47:06 +02:00

fix Taskvars.yml vars not available while interpolating vars prop

closes #40
This commit is contained in:
Andrey Nering 2017-07-15 14:40:58 -03:00
parent ac7ab42d94
commit 5ece1d74f6
4 changed files with 6 additions and 1 deletions

View File

@ -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
}
}

View File

@ -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 {

View File

@ -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:

1
testdata/params/Taskvars.yml vendored Normal file
View File

@ -0,0 +1 @@
PORTUGUESE: Olá, mundo!