Skip to content

Commit

Permalink
Fix hasura-ndc-go versioning (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
hgiasac authored Jun 17, 2024
1 parent b675a1c commit 4d27588
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/hasura-ndc-go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/alecthomas/kong v0.9.0
github.com/fatih/structtag v1.2.0
github.com/google/uuid v1.6.0
github.com/hasura/ndc-sdk-go v0.5.5-0.20240529173431-f84b38f2f7dc
github.com/hasura/ndc-sdk-go v0.6.0
github.com/rs/zerolog v1.33.0
github.com/stretchr/testify v1.9.0
golang.org/x/mod v0.17.0
Expand Down
4 changes: 2 additions & 2 deletions cmd/hasura-ndc-go/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/hasura/ndc-sdk-go v0.5.5-0.20240529173431-f84b38f2f7dc h1:Af3XoBAO8rWL7Uu4YNZSlIe6bgiEvBXbM6PXvUPetxg=
github.com/hasura/ndc-sdk-go v0.5.5-0.20240529173431-f84b38f2f7dc/go.mod h1:NXr0rBjTFeRcVnafp6v5R1m+g/v1BD3o0hvyzMapF2w=
github.com/hasura/ndc-sdk-go v0.6.0 h1:o3nqjLsYJWZDqUC2GR3Cy/vdUJuzyr7wc7lDivYQ8Js=
github.com/hasura/ndc-sdk-go v0.6.0/go.mod h1:Rqagv8hcpiTeyZaorWxuVQaJuG9NzlzaxWQWaY5WMoc=
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
Expand Down
9 changes: 7 additions & 2 deletions cmd/hasura-ndc-go/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,19 @@ func initBuildVersion() {
if BuildVersion != "" {
return
}

BuildVersion = DevVersion
bi, ok := debug.ReadBuildInfo()
if !ok {
BuildVersion = DevVersion
return
}
if bi.Main.Version != "" {
BuildVersion = bi.Main.Version
return
}

for _, s := range bi.Settings {
if s.Key == "vcs.revision" {
if s.Key == "vcs.revision" && s.Value != "" {
BuildVersion = s.Value
return
}
Expand Down

0 comments on commit 4d27588

Please sign in to comment.