Skip to content

Commit

Permalink
defult value is yes
Browse files Browse the repository at this point in the history
  • Loading branch information
nao1215 committed May 8, 2024
1 parent d398568 commit 36a7cfb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/print/print.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ func Question(ask string) bool {
cmdinfo.Name, color.GreenString("CHECK"), ask+" [Y/n] ")
_, err := FmtScanln(&response)
if err != nil {
// If user input only enter.
// If user input only enter, [Y/n] syntax is commonly used to denote that
// "yes" is the default.
// https://github.com/nao1215/gup/issues/146
if strings.Contains(err.Error(), "expected newline") {
return Question(ask)
return true
}
fmt.Fprint(os.Stderr, err.Error())
return false
Expand Down

0 comments on commit 36a7cfb

Please sign in to comment.