feat: Check for new version of the CLI when running commands#75
Merged
Conversation
maxatome
reviewed
Oct 17, 2025
internal/cmd/root.go
Outdated
| rootCmd.PersistentPreRun = func(cmd *cobra.Command, args []string) { | ||
| if http.Client == nil { | ||
| // Check if a new version is available in a separate goroutine | ||
| go func() { |
Member
There was a problem hiding this comment.
should only be launched if version.Version != "undefined"
rbeuque74
reviewed
Oct 17, 2025
internal/cmd/root.go
Outdated
| return | ||
| } | ||
| if data.TagName != "" && data.TagName != version.Version { | ||
| log.Printf("A new version of ovhcloud-cli is available: %s (current: %s)\n", data.TagName, version.Version) |
Member
There was a problem hiding this comment.
Will this behave correctly on WASM version ?
Collaborator
Author
There was a problem hiding this comment.
you're right, I will disable this check in the WASM binary
39bcbd5 to
c6a8fbd
Compare
deathiop
previously approved these changes
Oct 17, 2025
Signed-off-by: Arthur Amstutz <arthur.amstutz@corp.ovh.com>
c6a8fbd to
49fa000
Compare
maxatome
approved these changes
Oct 17, 2025
fluatovh
pushed a commit
to fluatovh/ovhcloud-cli
that referenced
this pull request
Nov 17, 2025
feat: Check for new version of the CLI when running commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Check if a new version of the CLI is available when running any command.
Fixes #56 (issue)
Type of change
Checklist:
go mod tidy