Skip to content

Commit

Permalink
Fix version command
Browse files Browse the repository at this point in the history
  • Loading branch information
royroyee committed Apr 12, 2024
1 parent f50b3ec commit ed8ff79
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,23 @@ import (
"github.com/spf13/cobra"
)

var VersionCli = "0.1.4"
const VersionCli = "0.1.4"

var versionCmd = &cobra.Command{
Use: "version",
Short: "Displays the current CLI version.",
Long: "Displays the current version of the CLI and checks if there is an available update.",
Run: func(cmd *cobra.Command, args []string) {
utils.CliInfo("Current version: %s", VersionCli)
release, skip := versionCheck()
if skip == false {
utils.CliWarning("Upgrade available. Current version: %s. Latest version: %s \n"+
"Visit %s for update instructions and release notes.", VersionCli, release.GetTagName(), release.GetHTMLURL())
return
} else {
utils.CliInfo("You are up to date! %s is the latest version available.", VersionCli)
}

utils.CliInfo("Current version (%s) is the latest.", release.GetTagName())
return
},
}
Expand Down

0 comments on commit ed8ff79

Please sign in to comment.