mirror of
https://github.com/charmbracelet/gum
synced 2024-05-03 15:03:20 +02:00
fix(input): Avoid reading from stdin if --value
is being used (#448)
This commit is contained in:
parent
eb0e8afeba
commit
dd557baf6a
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue