1
0
mirror of https://github.com/go-task/task.git synced 2025-01-14 04:35:50 +02:00

Moved handleVariables() into command loop

This commit is contained in:
Sascha Andres 2017-03-02 20:34:09 +01:00
parent 8619c8d417
commit 9abe71e967

View File

@ -111,11 +111,12 @@ func RunTask(name string) error {
return err 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 { 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 ( var (
output string output string
err error err error