Update disclaimer

This commit is contained in:
Taylor Gerring
2015-07-16 15:49:36 +02:00
parent 618991f136
commit cf5313f13e
3 changed files with 52 additions and 20 deletions

View File

@ -58,15 +58,16 @@ func PromptConfirm(prompt string) (bool, error) {
)
prompt = prompt + " [y/N] "
if liner.TerminalSupported() {
lr := liner.NewLiner()
defer lr.Close()
input, err = lr.Prompt(prompt)
} else {
fmt.Print(prompt)
input, err = bufio.NewReader(os.Stdin).ReadString('\n')
fmt.Println()
}
// if liner.TerminalSupported() {
// fmt.Println("term")
// lr := liner.NewLiner()
// defer lr.Close()
// input, err = lr.Prompt(prompt)
// } else {
fmt.Print(prompt)
input, err = bufio.NewReader(os.Stdin).ReadString('\n')
fmt.Println()
// }
if len(input) > 0 && strings.ToUpper(input[:1]) == "Y" {
return true, nil