fix IsTerminal usage for windows

This commit is contained in:
Cory Bennett
2018-04-15 19:10:29 -07:00
parent 84b6155b0d
commit 9ebd2cd64e
+2 -2
View File
@@ -2,7 +2,7 @@ package jiracmd
import (
"fmt"
"syscall"
"os"
"github.com/coryb/figtree"
"github.com/coryb/oreo"
@@ -32,7 +32,7 @@ func CmdLogoutRegistry() *jiracli.CommandRegistryEntry {
func CmdLogout(o *oreo.Client, globals *jiracli.GlobalOptions, opts *jiracli.CommonOptions) error {
if globals.AuthMethod() == "api-token" {
log.Noticef("No need to logout when using api-token authentication method")
if globals.GetPass() != "" && terminal.IsTerminal(syscall.Stdin) && terminal.IsTerminal(syscall.Stdout) {
if globals.GetPass() != "" && terminal.IsTerminal(int(os.Stdin.Fd())) && terminal.IsTerminal(int(os.Stdout.Fd())) {
delete := false
err := survey.AskOne(
&survey.Confirm{