Skip to content

Commit

Permalink
build(mage): 🐛 ensure environment is set up before running go generate
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuar committed Jun 27, 2024
1 parent 85faba6 commit 57a8b71
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion build/magefiles/preps.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,14 @@ func (Preps) Generate() error {
}
}

envMap, err := generateEnv()
if err != nil {
return errors.Join(ErrBuildFailed, err)
}

slog.Info("Running go generate...")

if err := sh.RunV("go", "generate", "-v", "./..."); err != nil {
if err := sh.RunWithV(envMap, "go", "generate", "-v", "./..."); err != nil {
return fmt.Errorf("failed to run go generate: %w", err)
}

Expand Down

0 comments on commit 57a8b71

Please sign in to comment.