Replies: 1 comment
-
TLDR:
Explanation:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Please describe your feature request.
I have a file with one top level parent that I want to remain at the top of the document, and then I have many other parents that I want to sort on a child key. I want to be able to sort only those subsequent parent nodes and leave the specific parent in whatever place in the file it exists in.
Note:
Describe the solution you'd like
If we have data1.yml like:
And we run a command:
yq '. |= sort_by(.) && ignorelines=[(1,4)]' data1.yml
it could output
Describe alternatives you've considered
I've tried running
yq '. |= sort_by(.)' data1.yml
which doesn't work as the node is not an array.Additional context
Add any other context or screenshots about the feature request here.
Beta Was this translation helpful? Give feedback.
All reactions