mirror of
https://github.com/mikefarah/yq.git
synced 2026-08-24 00:04:50 +08:00
Fixes dos line separator issue when reading expression file #1860
This commit is contained in:
+3
-1
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/mikefarah/yq/v4/pkg/yqlib"
|
||||
"github.com/spf13/cobra"
|
||||
@@ -256,7 +257,8 @@ func processArgs(originalArgs []string) (string, []string, error) {
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
expression = string(expressionBytes)
|
||||
//replace \r\n (windows) with good ol' unix file endings.
|
||||
expression = strings.ReplaceAll(string(expressionBytes), "\r\n", "\n")
|
||||
}
|
||||
|
||||
args := processStdInArgs(originalArgs)
|
||||
|
||||
Reference in New Issue
Block a user