From a3bad6380ff70955eae54af60d3443690ebc70bb Mon Sep 17 00:00:00 2001 From: poneding Date: Mon, 29 Apr 2024 00:21:40 +0800 Subject: [PATCH] update upgrade prompt logic --- cmd/upgrade.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/upgrade.go b/cmd/upgrade.go index f819904..a92a6fb 100644 --- a/cmd/upgrade.go +++ b/cmd/upgrade.go @@ -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 @@ -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()