Skip to content

Commit 7f4ee6b

Browse files
authored
fix: version check (#2120)
1 parent e46b322 commit 7f4ee6b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

internal/common/common.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ func CheckForVersionUpdate() {
6060
// versionCheck compares local to remote version
6161
func versionCheck() (res *CheckResponse, skip bool) {
6262
var latestVersion string
63+
flatVersion := strings.ReplaceAll(configs.K1Version, "v", "")
6364

6465
resp, err := http.Get("https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/k/kubefirst.rb")
6566

@@ -91,10 +92,10 @@ func versionCheck() (res *CheckResponse, skip bool) {
9192
latestVersion = matches[1]
9293

9394
return &CheckResponse{
94-
Current: configs.K1Version,
95-
Outdated: latestVersion < configs.K1Version,
96-
Latest: latestVersion == configs.K1Version,
97-
New: configs.K1Version > latestVersion,
95+
Current: flatVersion,
96+
Outdated: latestVersion < flatVersion,
97+
Latest: latestVersion == flatVersion,
98+
New: flatVersion > latestVersion,
9899
}, false
99100
}
100101

0 commit comments

Comments
 (0)