Skip to content

Commit

Permalink
Only report version check when it can be
Browse files Browse the repository at this point in the history
Signed-off-by: Stoned Elipot <[email protected]>
  • Loading branch information
stoned authored and hiddeco committed Aug 14, 2023
1 parent 408dc02 commit cb1a43d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ func PrintVersion(c *cli.Context) {
outdated, err := AIsNewerThanB(upstreamVersion, Version)
if err != nil {
out += fmt.Sprintf("\n[warning] failed to compare current version with latest: %v\n", err)
}
if outdated {
out += fmt.Sprintf("\n[info] sops %s is available, update with `go get -u github.com/getsops/sops/v3/cmd/sops`\n", upstreamVersion)
} else {
out += " (latest)\n"
if outdated {
out += fmt.Sprintf("\n[info] sops %s is available, update with `go get -u github.com/getsops/sops/v3/cmd/sops`\n", upstreamVersion)
} else {
out += " (latest)\n"
}
}
}
fmt.Fprintf(c.App.Writer, "%s", out)
Expand Down

0 comments on commit cb1a43d

Please sign in to comment.