mirror of
https://github.com/mikefarah/yq.git
synced 2025-01-27 00:47:56 +00:00
Return path, smart print
This commit is contained in:
parent
4fb44dbc47
commit
3d3eaf3034
2
yq.go
2
yq.go
@ -313,7 +313,7 @@ func printResults(matchingNodes []yqlib.MatchingNode, cmd *cobra.Command) error
|
|||||||
|
|
||||||
for _, mappedDoc := range matchingNodes {
|
for _, mappedDoc := range matchingNodes {
|
||||||
if mappedDoc.Node.Kind == yaml.ScalarNode {
|
if mappedDoc.Node.Kind == yaml.ScalarNode {
|
||||||
cmd.Println(mappedDoc.Node.Value)
|
cmd.Print(mappedDoc.Node.Value)
|
||||||
} else {
|
} else {
|
||||||
var encoder = yaml.NewEncoder(cmd.OutOrStdout())
|
var encoder = yaml.NewEncoder(cmd.OutOrStdout())
|
||||||
encoder.SetIndent(2)
|
encoder.SetIndent(2)
|
||||||
|
Loading…
Reference in New Issue
Block a user