Skip to content

Commit

Permalink
#11/setup fix plain input prompt not showing at all
Browse files Browse the repository at this point in the history
  • Loading branch information
David May committed Apr 9, 2024
1 parent 7cfe1d7 commit e3c76c1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/console/prompt_input.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,15 @@ func (i *Input) Run() error {
if i.title != "" {
fmt.Fprintln(os.Stderr, i.title)
}

input := ""
for i.validate(input) != nil {
for {
fmt.Fprintf(os.Stderr, "%s ", i.prompt)
input, _ = r.ReadString('\n')
input = strings.TrimSpace(input)
if err := i.validate(input); err == nil {
break
}
}
*i.value = input
return nil
Expand Down

0 comments on commit e3c76c1

Please sign in to comment.