feat: parse templates in collection-type variables (#1526)

* refactor: replacer

* feat: move traverser to deepcopy package

* feat: nested map variable templating

* refactor: ReplaceVar function

* feat: test cases

* fix: TraverseStringsFunc copy value instead of pointer
This commit is contained in:
Pete Davison
2024-03-10 17:11:07 +00:00
committed by GitHub
parent 19a4d8f928
commit 08a888dc8a
13 changed files with 243 additions and 135 deletions

View File

@@ -22,11 +22,10 @@ func Dotenv(c *compiler.Compiler, tf *ast.Taskfile, dir string) (*ast.Vars, erro
}
env := &ast.Vars{}
tr := templater.Templater{Vars: vars}
cache := &templater.Cache{Vars: vars}
for _, dotEnvPath := range tf.Dotenv {
dotEnvPath = tr.Replace(dotEnvPath)
dotEnvPath = templater.Replace(dotEnvPath, cache)
if dotEnvPath == "" {
continue
}