Skip to content

Commit

Permalink
chore: add git commit to version output
Browse files Browse the repository at this point in the history
  • Loading branch information
vprasanth committed Mar 9, 2021
1 parent fa0ac1b commit 651c025
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions internal/build-info/build_info.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package buildinfo

import (
"fmt"
"runtime"
)

Expand Down Expand Up @@ -38,3 +39,7 @@ func NewBuildInfo(version, branch, buildDate, buildUser, goVersion, revision str
Revision: revision,
}
}

func GetVersionWithCommit() string {
return fmt.Sprintf("%v %v", Version, Revision)
}
5 changes: 2 additions & 3 deletions internal/cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ package cli

import (
"context"
"os"

"github.com/auth0/auth0-cli/internal/ansi"
"github.com/auth0/auth0-cli/internal/build-info"
"github.com/auth0/auth0-cli/internal/display"
"github.com/spf13/cobra"
"os"
)

// Execute is the primary entrypoint of the CLI app.
Expand All @@ -27,7 +26,7 @@ func Execute() {
SilenceErrors: true,
Short: "Supercharge your development workflow.",
Long: "Supercharge your development workflow.\n" + getLogin(cli),
Version: buildinfo.Version,
Version: buildinfo.GetVersionWithCommit(),

PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
// If the user is trying to login, no need to go
Expand Down

0 comments on commit 651c025

Please sign in to comment.