Skip to content

Commit 0d0f7e7

Browse files
committed
Fix the flakiness.
1 parent a82bba2 commit 0d0f7e7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

compiler.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,18 @@ func (c *Compiler) getVariables(t *ast.Task, call *Call, evaluateShVars bool) (*
108108
}
109109
}
110110

111+
if !evaluateShVars {
112+
// Add includedTaskfile.Vars, and replace/overwrite taskfile.Vars,
113+
// _before_ calculating the t.Dir using the templater. Because
114+
// evaluateShVars is not set, the dir used when creating rangeFunc
115+
// will not be used (sh vars are evaluated on subsequent calls).
116+
for k, v := range t.IncludedTaskfileVars.All() {
117+
if err := rangeFunc(k, v); err != nil {
118+
return nil, err
119+
}
120+
}
121+
}
122+
111123
// Calculate the t.Dir now based on values saved during AST parsing
112124
// and then get a Task RangeFunc.
113125
dir := c.Dir

0 commit comments

Comments
 (0)