File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -138,22 +138,15 @@ func (p *Printer) PromptForConfirmation(prompt string) error {
138138
139139// Prompts the user for confirmation by pressing Enter.
140140//
141- // Returns nil only if the user (explicitly) press directly enter.
142- // Returns ErrAborted if the user press anything else before pressing enter.
141+ // Returns nil if the user presses Enter.
143142func (p * Printer ) PromptForEnter (prompt string ) error {
144- reader := bufio .NewReaderSize (p .Cmd .InOrStdin (), 1 )
145-
143+ reader := bufio .NewReader (p .Cmd .InOrStdin ())
146144 p .Cmd .PrintErr (prompt )
147- answer , err := reader .ReadByte ( )
145+ _ , err := reader .ReadString ( '\n' )
148146 if err != nil {
149147 return fmt .Errorf ("read user response: %w" , err )
150148 }
151-
152- // ASCII code for Enter (newline) is 10.
153- if answer == 10 {
154- return nil
155- }
156- return errAborted
149+ return nil
157150}
158151
159152// Shows the content in the command's stdout using the "less" command
You can’t perform that action at this time.
0 commit comments