Skip to content

Commit c4f6a2f

Browse files
committed
fix(input): Avoid reading from stdin if --value is being used
1 parent 46328de commit c4f6a2f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

input/command.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ import (
1818
// https://github.com/charmbracelet/bubbles/textinput
1919
func (o Options) Run() error {
2020
i := textinput.New()
21-
if in, _ := stdin.Read(); in != "" && o.Value == "" {
22-
i.SetValue(in)
23-
} else {
21+
if o.Value != "" {
2422
i.SetValue(o.Value)
23+
} else if in, _ := stdin.Read(); in != "" {
24+
i.SetValue(in)
2525
}
2626

2727
i.Focus()

0 commit comments

Comments
 (0)