fixes errors with CR in write --value

This commit is contained in:
mikael 2023-03-08 23:23:46 +01:00 committed by Maas Lalani
parent 65f5a7e44e
commit f8adcd649b

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()