File tree 2 files changed +6
-1
lines changed
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,6 @@ func login() *cobra.Command {
44
44
return xerrors .Errorf ("has initial user: %w" , err )
45
45
}
46
46
if ! hasInitialUser {
47
- // TODO: Bryan - is this check correct on windows?
48
47
if ! isTTY (cmd .InOrStdin ()) {
49
48
return xerrors .New ("the initial user cannot be created in non-interactive mode. use the API" )
50
49
}
Original file line number Diff line number Diff line change 5
5
"io"
6
6
"net/url"
7
7
"os"
8
+ "runtime"
8
9
"strings"
9
10
10
11
"github.com/fatih/color"
@@ -109,6 +110,11 @@ func createConfig(cmd *cobra.Command) config.Root {
109
110
// This accepts a reader to work with Cobra's "InOrStdin"
110
111
// function for simple testing.
111
112
func isTTY (reader io.Reader ) bool {
113
+ // TODO(Bryan): Is there a reliable way to check this on windows?
114
+ if runtime .GOOS == "windows" {
115
+ return true
116
+ }
117
+
112
118
file , ok := reader .(* os.File )
113
119
if ! ok {
114
120
return false
You can’t perform that action at this time.
0 commit comments