File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,9 @@ func (b *BuildInfo) GetUserAgent() string {
5757}
5858
5959func (b * BuildInfo ) checkVersion (ctx context.Context ) {
60- if ! b .IsRelease () || ExtractEnv (ctx , scwDisableCheckVersionEnv ) == "true" {
60+ cmd := extractMeta (ctx ).command
61+ cmdDisableCheckVersion := cmd != nil && cmd .DisableVersionCheck
62+ if ! b .IsRelease () || ExtractEnv (ctx , scwDisableCheckVersionEnv ) == "true" || cmdDisableCheckVersion {
6163 ExtractLogger (ctx ).Debug ("skipping check version" )
6264 return
6365 }
Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ type Command struct {
3535 // DisableTelemetry disable telemetry for the command.
3636 DisableTelemetry bool
3737
38+ // DisableVersionCheck disable the version check to avoid superfluous message
39+ DisableVersionCheck bool
40+
3841 // Hidden hides the command form usage and auto-complete.
3942 Hidden bool
4043
Original file line number Diff line number Diff line change @@ -19,14 +19,20 @@ import (
1919)
2020
2121func GetCommands () * core.Commands {
22- return core .NewCommands (
22+ cmds := core .NewCommands (
2323 autocompleteRootCommand (),
2424 autocompleteInstallCommand (),
2525 autocompleteCompleteBashCommand (),
2626 autocompleteCompleteFishCommand (),
2727 autocompleteCompleteZshCommand (),
2828 autocompleteScriptCommand (),
2929 )
30+
31+ for _ , cmd := range cmds .GetAll () {
32+ cmd .DisableVersionCheck = true
33+ }
34+
35+ return cmds
3036}
3137
3238func autocompleteRootCommand () * core.Command {
You can’t perform that action at this time.
0 commit comments