diff --git a/main.go b/main.go index fc1ae29..2059df8 100644 --- a/main.go +++ b/main.go @@ -13,7 +13,7 @@ import ( ) const ( - version = "0.21.2" + version = "0.22.0" ) type args struct { @@ -59,7 +59,7 @@ func main() { err = p.Apply() if err != nil { - fmt.Printf("Some provisioners had errors: %v\n", err) + fmt.Printf("Some provisioners had errors:\n%v\n", err) os.Exit(1) } } diff --git a/provision/provision.go b/provision/provision.go index bdfc3d6..6024d22 100644 --- a/provision/provision.go +++ b/provision/provision.go @@ -33,7 +33,18 @@ func (p provisioners) apply() error { provErrs = append(provErrs, err) } - return errors.Join(provErrs...) + var uniqErrs []error + seenErr := make(map[string]error) + for _, err := range provErrs { + msg := err.Error() + _, ok := seenErr[msg] + if !ok { + seenErr[msg] = err + uniqErrs = append(uniqErrs, err) + } + } + + return errors.Join(uniqErrs...) } func newProvisioners(allProvisioners []provisionFn, filter []string) (provisioners, error) {