fixes errors with CR in write --value

This commit is contained in:
mikael 2023-03-08 23:23:46 +01:00
parent 1267b7a78e
commit 249f918230
No known key found for this signature in database
GPG key ID: 5B84855A310FE33F

View file

@ -3,6 +3,7 @@ package write
import (
"fmt"
"os"
"strings"
"github.com/alecthomas/kong"
"github.com/charmbracelet/bubbles/textarea"
@ -18,7 +19,7 @@ import (
func (o Options) Run() error {
in, _ := stdin.Read()
if in != "" && o.Value == "" {
o.Value = in
o.Value = strings.Replace(in, "\r", "", -1)
}
a := textarea.New()