Merge PR #4919: Fix GetConfirmation User Input Bug

This commit is contained in:
Henrik Aasted Sørensen
2019-08-19 09:22:07 -04:00
committed by Alexander Bezobchuk
parent 70d50a6a61
commit 91b53f2698
2 changed files with 7 additions and 1 deletions
+6 -1
View File
@@ -74,7 +74,12 @@ func GetConfirmation(prompt string, buf *bufio.Reader) (bool, error) {
return false, err
}
response = strings.ToLower(strings.TrimSpace(response))
response = strings.TrimSpace(response)
if len(response) == 0 {
return false, nil
}
response = strings.ToLower(response)
if response[0] == 'y' {
return true, nil
}