Fixed printing of scalars

This commit is contained in:
Mike Farah
2020-03-01 17:13:00 +11:00
parent ed234e37ce
commit 6b07143af7
4 changed files with 77 additions and 2 deletions
+3
View File
@@ -103,6 +103,9 @@ func transformNode(node *yaml.Node) *yaml.Node {
func printNode(node *yaml.Node, writer io.Writer) error {
var encoder yqlib.Encoder
if node.Kind == yaml.ScalarNode {
return writeString(writer, node.Value+"\n")
}
if outputToJSON {
encoder = yqlib.NewJsonEncoder(writer, prettyPrint, indent)
} else {