only prompt on logout if stdin and stdout are terminals

This commit is contained in:
Cory Bennett
2018-04-15 17:15:48 -07:00
parent 64ce3812a6
commit 09a61c3ea1
+1 -1
View File
@@ -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) {
if globals.GetPass() != "" && terminal.IsTerminal(syscall.Stdin) && terminal.IsTerminal(syscall.Stdout) {
delete := false
err := survey.AskOne(
&survey.Confirm{