4 ms·
What are you using yq for? Unless you use YAML-only features (e.g. integers, arrays, and objects as object keys), it seems like it would be easier to just pipe
by ainar-g 3y ago
What are you using yq for? Unless you use YAML-only features (e.g. integers, arrays, and objects as object keys), it seems like it would be easier to just pipe-convert your YAML to JSON and process it with jq.
- dividedbyzero 3y agoNot them but I use it in a few places to make automated edits to yaml files.
- ainar-g 3y agoDepending on whether or not the resulting YAML is supposed to be human-readable[1], you can just produce JSON output, since YAML 1.2 is a superset of JSON. I did that at one of the places I worked in at the time, and it worked very well. [1]: I personally think that JSON is plenty readable, but a lot of people seem to disagree.
- dividedbyzero 3y agoI use it to make small edits to yaml configuration files which are supposed to remain human-editable and keep their comments and ideally also whitespace. I'm sure some people do enjoy working with raw JSON, but I'm very much not such a person.
- ainar-g 3y agoAh, understandable.