Skip to content

Commit

Permalink
🧹 provide more info on errors in make providers/config
Browse files Browse the repository at this point in the history
We currently silently eat all output, which is not helpful when errors occur. This provides the output with any errors that might have led to the build failing. Pure QoL...

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
  • Loading branch information
arlimus committed Jul 29, 2024
1 parent e72d437 commit 806720e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions providers-sdk/v1/util/configure/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package main

import (
"bytes"
"errors"
"fmt"
"go/format"
Expand Down Expand Up @@ -198,8 +199,12 @@ func init() {
func buildProviders(providers []string) {
for i, provider := range providers {
cmd := exec.Command("make", "providers/build/"+provider)
var out bytes.Buffer
cmd.Stdout = &out
cmd.Stderr = &out
log.Debug().Str("provider", provider).Msg("build provider " + strconv.Itoa(i+1) + "/" + strconv.Itoa(len(providers)))
if err := cmd.Run(); err != nil {
fmt.Println(out.String())
log.Error().Err(err).Str("provider", provider).Msg("failed to build provider")
}

Expand Down

0 comments on commit 806720e

Please sign in to comment.