mirror of
https://github.com/charmbracelet/gum
synced 2024-05-09 17:56:37 +02:00
fixes errors with CR in write --value
This commit is contained in:
parent
65f5a7e44e
commit
f8adcd649b
|
@ -3,6 +3,7 @@ package write
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/alecthomas/kong"
|
"github.com/alecthomas/kong"
|
||||||
"github.com/charmbracelet/bubbles/textarea"
|
"github.com/charmbracelet/bubbles/textarea"
|
||||||
|
@ -18,7 +19,7 @@ import (
|
||||||
func (o Options) Run() error {
|
func (o Options) Run() error {
|
||||||
in, _ := stdin.Read()
|
in, _ := stdin.Read()
|
||||||
if in != "" && o.Value == "" {
|
if in != "" && o.Value == "" {
|
||||||
o.Value = in
|
o.Value = strings.Replace(in, "\r", "", -1)
|
||||||
}
|
}
|
||||||
|
|
||||||
a := textarea.New()
|
a := textarea.New()
|
||||||
|
|
Loading…
Reference in a new issue