Skip to content

Commit 1bff2f1

Browse files
committed
Add comment in 'isTTY' function
1 parent 1df68f3 commit 1bff2f1

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

cli/login.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ func login() *cobra.Command {
4444
return xerrors.Errorf("has initial user: %w", err)
4545
}
4646
if !hasInitialUser {
47-
// TODO: Bryan - is this check correct on windows?
4847
if !isTTY(cmd.InOrStdin()) {
4948
return xerrors.New("the initial user cannot be created in non-interactive mode. use the API")
5049
}

cli/root.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"io"
66
"net/url"
77
"os"
8+
"runtime"
89
"strings"
910

1011
"github.com/fatih/color"
@@ -109,6 +110,11 @@ func createConfig(cmd *cobra.Command) config.Root {
109110
// This accepts a reader to work with Cobra's "InOrStdin"
110111
// function for simple testing.
111112
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+
112118
file, ok := reader.(*os.File)
113119
if !ok {
114120
return false

0 commit comments

Comments
 (0)