Skip to content

Commit

Permalink
Recompile task after runDeps to reload envs set by deps
Browse files Browse the repository at this point in the history
  • Loading branch information
hori-ryota committed Nov 26, 2024
1 parent c28eb20 commit 90fd17b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions task.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,13 @@ func (e *Executor) RunTask(ctx context.Context, call *ast.Call) error {
if err := e.runDeps(ctx, t); err != nil {
return err
}
if len(t.Deps) > 0 {
// Recompile the task after running dependencies to reload environment variables from dotenv files which may have been set up during the dependency execution
t, err = e.CompiledTask(call)
if err != nil {
return err
}
}

skipFingerprinting := e.ForceAll || (!call.Indirect && e.Force)
if !skipFingerprinting {
Expand Down

0 comments on commit 90fd17b

Please sign in to comment.