Skip to content

Commit

Permalink
update version logging
Browse files Browse the repository at this point in the history
  • Loading branch information
mxyng committed Oct 28, 2021
1 parent cc6d180 commit b721de5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"text/tabwriter"

"github.com/infrahq/infra/internal"
"github.com/infrahq/infra/internal/logging"
"golang.org/x/mod/semver"
)

Expand Down Expand Up @@ -89,11 +90,11 @@ func checkUpdate(clientVersion, serverVersion string) error {
}

if clientSemVer != "v0.0.0-development" && semver.Compare(latestSemVer, clientSemVer) > 0 {
fmt.Fprintf(os.Stderr, "Infra CLI (%s) is out of date. Please update to %s.\n", clientVersion, latestVersion)
logging.S.Warnf("Infra CLI (%s) is out of date. Please update to %s.", clientVersion, latestVersion)
}

if serverSemVer != "v0.0.0-development" && semver.IsValid(serverSemVer) && semver.Compare(latestSemVer, serverSemVer) > 0 {
fmt.Fprintf(os.Stderr, "Infra (%s) is out of date. Please update to %s.\n", serverVersion, latestVersion)
logging.S.Warnf("Infra (%s) is out of date. Please update to %s.", serverVersion, latestVersion)
}

return nil
Expand Down

0 comments on commit b721de5

Please sign in to comment.