Skip to content

Commit

Permalink
update upgrade prompt logic
Browse files Browse the repository at this point in the history
  • Loading branch information
poneding committed Apr 28, 2024
1 parent 56bdb61 commit 1f5b3ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion cmd/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ func runUpgrade() {
targetVersion = "latest"
}

if targetVersion == version {
if targetVersion == version && targetVersion != "latest" {
fmt.Printf("✓ Current version: %s, upgradtion ignored.\n", version)
return
}

// remote version check
Expand Down Expand Up @@ -86,6 +87,11 @@ func runUpgrade() {
}

targetVersion = result.TagName
if targetVersion == version {
fmt.Printf("✓ Current version: %s, you are up to date.\n", version)
return
}

fmt.Printf("✓ Version %s is available, upgrading now...\n", targetVersion)

upgrade()
Expand Down
2 changes: 1 addition & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/spf13/cobra"
)

const version = "v1.0.0"
const version = "v1.0.1"

// versionCmd represents the version command
var versionCmd = &cobra.Command{
Expand Down

0 comments on commit 1f5b3ad

Please sign in to comment.