Skip to content

Commit

Permalink
refactored use of SempVersionDetails
Browse files Browse the repository at this point in the history
  • Loading branch information
bczoma committed Nov 2, 2023
1 parent 5deda42 commit 7faab5e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"os"
"terraform-provider-solacebroker/cmd"
"terraform-provider-solacebroker/internal/broker"
_ "terraform-provider-solacebroker/internal/broker/generated"
generated "terraform-provider-solacebroker/internal/broker/generated"

"github.com/hashicorp/terraform-plugin-framework/providerserver"
)
Expand All @@ -41,10 +41,11 @@ var (
)

func main() {
if broker.SempDetail.Platform != expectedPlatform {
if generated.Platform != expectedPlatform {
fmt.Println(fmt.Sprintf("Provider error: wrong platform SEMP API spec \"%s\" used, expected \"%s\"", broker.SempDetail.Platform, expectedPlatform))
os.Exit(1)
}
broker.RegisterSempVersionDetails(generated.BasePath, generated.SempVersion, generated.Platform)
broker.ProviderVersion = version
if len(os.Args) > 1 && (os.Args[1] == "generate" || os.Args[1] == "help" || os.Args[1] == "--help" || os.Args[1] == "-h" || os.Args[1] == "version") {
err := cmd.Execute()
Expand Down

0 comments on commit 7faab5e

Please sign in to comment.