Skip to content

Commit 7c8f976

Browse files
committed
chore: stdin support windows
Signed-off-by: Ling Samuel (WSL) <[email protected]>
1 parent 84e9203 commit 7c8f976

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

cmd/configure.go

+6-8
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,14 @@ import (
99
"crypto/x509"
1010
"errors"
1111
"fmt"
12-
"net/url"
13-
"os"
14-
"path/filepath"
15-
"strings"
16-
"syscall"
17-
1812
"github.com/fatih/color"
1913
"github.com/spf13/cobra"
2014
"github.com/spf13/viper"
2115
"golang.org/x/term"
16+
"net/url"
17+
"os"
18+
"path/filepath"
19+
"strings"
2220
)
2321

2422
// newConfigureCmd represents the configure command
@@ -177,8 +175,8 @@ func saveConfiguration(cmd *cobra.Command) error {
177175

178176
if rootConfig.Token == "" || overwrite {
179177
fmt.Println("Please enter the APISIX token: ")
180-
if term.IsTerminal(syscall.Stdin) {
181-
token, err := term.ReadPassword(syscall.Stdin)
178+
if term.IsTerminal(int(os.Stdin.Fd())) {
179+
token, err := term.ReadPassword(int(os.Stdin.Fd()))
182180
if err != nil {
183181
return err
184182
}

0 commit comments

Comments
 (0)