File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -65,11 +65,17 @@ func Root() *cobra.Command {
65
65
SilenceUsage : true ,
66
66
Long : `Coder — A tool for provisioning self-hosted development environments.
67
67
` ,
68
- PersistentPreRunE : func (cmd * cobra.Command , _ []string ) error {
68
+ PersistentPreRunE : func (cmd * cobra.Command , args []string ) error {
69
69
if varSuppressVersion {
70
70
return nil
71
71
}
72
72
73
+ // Login handles checking the versions itself since it
74
+ // has a handle to an unauthenticated client.
75
+ if cmd .Name () == "login" {
76
+ return nil
77
+ }
78
+
73
79
client , err := createClient (cmd )
74
80
// If the client is unauthenticated we can ignore the check.
75
81
// The child commands should handle an unauthenticated client.
@@ -357,6 +363,10 @@ func FormatCobraError(err error, cmd *cobra.Command) string {
357
363
}
358
364
359
365
func checkVersions (cmd * cobra.Command , client * codersdk.Client ) error {
366
+ if varSuppressVersion {
367
+ return nil
368
+ }
369
+
360
370
clientVersion := buildinfo .Version ()
361
371
362
372
info , err := client .BuildInfo (cmd .Context ())
You can’t perform that action at this time.
0 commit comments