mirror of
https://github.com/go-task/task.git
synced 2026-07-08 14:35:18 +00:00
feat: ability to resolve refs using templating syntax (#1612)
* feat: resolve references using templating syntax * refactor: moved when references are resolved to one place * fix: linter * docs: update map variables doc
This commit is contained in:
@@ -62,10 +62,6 @@ func (c *Compiler) getVariables(t *ast.Task, call *ast.Call, evaluateShVars bool
|
||||
cache := &templater.Cache{Vars: result}
|
||||
// Replace values
|
||||
newVar := templater.ReplaceVar(v, cache)
|
||||
// If the variable is a reference, we can resolve it
|
||||
if newVar.Ref != "" {
|
||||
newVar.Value = result.Get(newVar.Ref).Value
|
||||
}
|
||||
// If the variable should not be evaluated, but is nil, set it to an empty string
|
||||
// This stops empty interface errors when using the templater to replace values later
|
||||
if !evaluateShVars && newVar.Value == nil {
|
||||
|
||||
Reference in New Issue
Block a user