Skip to content

Commit

Permalink
Adjust build variables to goreleaser
Browse files Browse the repository at this point in the history
Adjust to build variables to goreleaser defaults, which are lowercased.
  • Loading branch information
igolaizola committed Jul 6, 2023
1 parent 8959628 commit 16e740d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cmd/igogpt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (
)

// Build flags
var Version = ""
var Commit = ""
var Date = ""
var version = ""
var commit = ""
var date = ""

func main() {
// Create signal based context
Expand Down Expand Up @@ -158,7 +158,7 @@ func newVersionCommand() *ffcli.Command {
ShortUsage: "igogpt version",
ShortHelp: "print version",
Exec: func(ctx context.Context, args []string) error {
v := Version
v := version
if v == "" {
if buildInfo, ok := debug.ReadBuildInfo(); ok {
v = buildInfo.Main.Version
Expand All @@ -168,11 +168,11 @@ func newVersionCommand() *ffcli.Command {
v = "dev"
}
versionFields := []string{v}
if Commit != "" {
versionFields = append(versionFields, Commit)
if commit != "" {
versionFields = append(versionFields, commit)
}
if Date != "" {
versionFields = append(versionFields, Date)
if date != "" {
versionFields = append(versionFields, date)
}
fmt.Println(strings.Join(versionFields, " "))
return nil
Expand Down

0 comments on commit 16e740d

Please sign in to comment.