File tree 3 files changed +13
-2
lines changed
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 {
57
57
}
58
58
59
59
func (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 {
61
63
ExtractLogger (ctx ).Debug ("skipping check version" )
62
64
return
63
65
}
Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ type Command struct {
35
35
// DisableTelemetry disable telemetry for the command.
36
36
DisableTelemetry bool
37
37
38
+ // DisableVersionCheck disable the version check to avoid superfluous message
39
+ DisableVersionCheck bool
40
+
38
41
// Hidden hides the command form usage and auto-complete.
39
42
Hidden bool
40
43
Original file line number Diff line number Diff line change @@ -19,14 +19,20 @@ import (
19
19
)
20
20
21
21
func GetCommands () * core.Commands {
22
- return core .NewCommands (
22
+ cmds := core .NewCommands (
23
23
autocompleteRootCommand (),
24
24
autocompleteInstallCommand (),
25
25
autocompleteCompleteBashCommand (),
26
26
autocompleteCompleteFishCommand (),
27
27
autocompleteCompleteZshCommand (),
28
28
autocompleteScriptCommand (),
29
29
)
30
+
31
+ for _ , cmd := range cmds .GetAll () {
32
+ cmd .DisableVersionCheck = true
33
+ }
34
+
35
+ return cmds
30
36
}
31
37
32
38
func autocompleteRootCommand () * core.Command {
You can’t perform that action at this time.
0 commit comments