1
0
mirror of https://github.com/go-task/task.git synced 2025-07-30 09:23:07 +03:00

only get variable map twice and implement vars template

ref #40
This commit is contained in:
Andrey Nering
2017-07-08 16:00:17 -03:00
parent 82e1c0f810
commit 5268df6bfd
2 changed files with 32 additions and 12 deletions

14
task.go
View File

@ -116,10 +116,24 @@ func (e *Executor) RunTask(ctx context.Context, call Call) error {
return &MaximumTaskCallExceededError{task: call.Task}
}
var err error
call.Vars, err = e.getVariables(call)
if err != nil {
return err
}
if err := e.runDeps(ctx, call); err != nil {
return err
}
// FIXME: doing again, since a var may have been overriden
// using the `set:` attribute of a dependecy.
// Remove this when `set` (that is deprecated) be removed
call.Vars, err = e.getVariables(call)
if err != nil {
return err
}
if !e.Force {
upToDate, err := e.isTaskUpToDate(ctx, call)
if err != nil {