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

Make dynamic variables run on the right directory

It was always running in the main Taskfile dir, even when the variable was
declared in an included taskfile in another directory or when task had a
custom dir.

Closes #384
This commit is contained in:
Andrey Nering
2021-01-07 11:17:38 -03:00
parent cbdd088188
commit 59d2733b88
10 changed files with 64 additions and 14 deletions

View File

@ -60,7 +60,7 @@ func (e *Executor) CompiledTask(call taskfile.Call) (*taskfile.Task, error) {
new.Env.Merge(r.ReplaceVars(e.Taskfile.Env))
new.Env.Merge(r.ReplaceVars(origTask.Env))
err = new.Env.Range(func(k string, v taskfile.Var) error {
static, err := e.Compiler.HandleDynamicVar(v)
static, err := e.Compiler.HandleDynamicVar(v, new.Dir)
if err != nil {
return err
}