Skip to content

Commit

Permalink
Merge pull request #3 from murdockq/master
Browse files Browse the repository at this point in the history
Fix windows compatibility with command line '\r\n'
  • Loading branch information
Alessio Pracchia authored Nov 14, 2017
2 parents 620e305 + ee1279f commit f8fb579
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions quest.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ func (q *Question) wait() error {
if q.choices {
q.print(q.color("?"), " ", "Answer", " ")
}
r, err := reader.ReadString('\n')
r, _, err := reader.ReadLine()
if err != nil {
return err
}
q.response = r[:len(r)-1]
q.response = string(r)
if abort := q.abort(q.response); abort.value != "" {
abort.status = true
return nil
Expand Down

0 comments on commit f8fb579

Please sign in to comment.