mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-05 00:54:51 +08:00
explode when outputting to json
This commit is contained in:
@@ -52,6 +52,13 @@ func New() *cobra.Command {
|
||||
return err
|
||||
}
|
||||
|
||||
if outputToJSON {
|
||||
explodeOp := treeops.Operation{OperationType: treeops.Explode}
|
||||
explodeNode := treeops.PathTreeNode{Operation: &explodeOp}
|
||||
pipeOp := treeops.Operation{OperationType: treeops.Pipe}
|
||||
pathNode = &treeops.PathTreeNode{Operation: &pipeOp, Lhs: pathNode, Rhs: &explodeNode}
|
||||
}
|
||||
|
||||
matchingNodes, err := evaluate("-", pathNode)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user