yq a yaml wrapper for jq
With yq 4.18.1+
cat "$DEFAULTS_FILE" | yq -P # or yq --prettyPrint
See: https://mikefarah.gitbook.io/yq/#notice-for-v4.x-versions-prior-to-4.18.1
With yq version 4.8.0:
cat $DEFAULTS_FILE | yq e -P -
eorevalhandles file separately.eaoreval-allwill merge files first.-Por--prettyPrintYAML output-from STDIN
Note: you can go the other way (yaml to json) too yq e -j file.yaml
With yq version 3.3.2:
cat $DEFAULTS_FILE | yq r -P -
rread-P–prettyPrint-from STDIN