Skip to content

Commit

Permalink
fix(input): Avoid reading from stdin if --value is being used (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
piero-vic authored Nov 14, 2023
1 parent eb0e8af commit dd557ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions input/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import (
// https://github.com/charmbracelet/bubbles/textinput
func (o Options) Run() error {
i := textinput.New()
if in, _ := stdin.Read(); in != "" && o.Value == "" {
i.SetValue(in)
} else {
if o.Value != "" {
i.SetValue(o.Value)
} else if in, _ := stdin.Read(); in != "" {
i.SetValue(in)
}

i.Focus()
Expand Down

0 comments on commit dd557ba

Please sign in to comment.