From 9abe71e9670fe6cd3c22b3a8620ee3db4a2e7b61 Mon Sep 17 00:00:00 2001 From: Sascha Andres Date: Thu, 2 Mar 2017 20:34:09 +0100 Subject: [PATCH] Moved handleVariables() into command loop --- task.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/task.go b/task.go index 62251524..32ea2818 100644 --- a/task.go +++ b/task.go @@ -111,11 +111,12 @@ func RunTask(name string) error { return err } } - vars, err = t.handleVariables() // read in a second time, as a dependency could have set a new env variable - if err != nil { - return &taskRunError{name, err} - } for _, c := range t.Cmds { + // read in a each time, as a command could change a variable or it has been changed by a dependency + vars, err = t.handleVariables() + if err != nil { + return &taskRunError{name, err} + } var ( output string err error