Skip to content

Commit

Permalink
add version info
Browse files Browse the repository at this point in the history
Signed-off-by: FingerLeader <[email protected]>
  • Loading branch information
FingerLeader committed Jul 15, 2024
1 parent c547996 commit f055ac9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/cli/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@ func VersionCmd(h *internal.Helper) *cobra.Command {

// Format formats a version string with the given information.
func Format(ver, commit, buildDate string) string {
fmt.Println("ver:", ver)
if ver == version.DevVersion && buildDate == "" && commit == "" {
return fmt.Sprintf("%s version (built from source)", config.CliName)
}

if ver == version.NightlyVersion {
if strings.Contains(ver, version.NightlyVersion) {
return fmt.Sprintf("%s version %s-%s (commit: %s)\n", config.CliName, ver, buildDate, commit)
}

Expand Down

0 comments on commit f055ac9

Please sign in to comment.