Skip to content

Commit

Permalink
fix: version check (#2120)
Browse files Browse the repository at this point in the history
  • Loading branch information
CristhianF7 authored Mar 15, 2024
1 parent e46b322 commit 7f4ee6b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions internal/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func CheckForVersionUpdate() {
// versionCheck compares local to remote version
func versionCheck() (res *CheckResponse, skip bool) {
var latestVersion string
flatVersion := strings.ReplaceAll(configs.K1Version, "v", "")

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

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

return &CheckResponse{
Current: configs.K1Version,
Outdated: latestVersion < configs.K1Version,
Latest: latestVersion == configs.K1Version,
New: configs.K1Version > latestVersion,
Current: flatVersion,
Outdated: latestVersion < flatVersion,
Latest: latestVersion == flatVersion,
New: flatVersion > latestVersion,
}, false
}

Expand Down

0 comments on commit 7f4ee6b

Please sign in to comment.