File tree 1 file changed +10
-5
lines changed
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,16 @@ const (
25
25
goosDarwin = "darwin"
26
26
)
27
27
28
+ func init () {
29
+ // Hide output from the browser library,
30
+ // otherwise we can get really verbose and non-actionable messages
31
+ // when in SSH or another type of headless session
32
+ // NOTE: This needs to be in `init` to prevent data races
33
+ // (multiple threads trying to set the global browser.Std* variables)
34
+ browser .Stderr = ioutil .Discard
35
+ browser .Stdout = ioutil .Discard
36
+ }
37
+
28
38
func login () * cobra.Command {
29
39
return & cobra.Command {
30
40
Use : "login <url>" ,
@@ -223,10 +233,5 @@ func openURL(urlToOpen string) error {
223
233
return exec .Command (cmd , args ... ).Start ()
224
234
}
225
235
226
- // Hide output from the browser library,
227
- // otherwise we can get really verbose and non-actionable messages
228
- // when in SSH or another type of headless session
229
- browser .Stderr = ioutil .Discard
230
- browser .Stdout = ioutil .Discard
231
236
return browser .OpenURL (urlToOpen )
232
237
}
You can’t perform that action at this time.
0 commit comments