Description
This is a request to get more information on the -m / --multi <dir>
option of jsonnet.
I first found out about this from the very clever use by coreos/kube-prometheus here:
https://github.com/coreos/kube-prometheus#compiling
jsonnet -J vendor -m manifests "${1-example.jsonnet}" | xargs -I{} sh -c 'cat {} | gojsontoyaml > {}.yaml; rm -f {}' -- {}
This script runs the jsonnet code, then reads each key of the generated json and uses that as the file name, and writes the value of that key to that file, and converts each json manifest to yaml.
It appears as though, if your file is an object, each key of that object becomes the file names that are both sent to stdout as well as used as the filename that is written. The contents of the file being the value of that key.
I was not able to find any official documentation that actually explained this behavior, and the help from the cmd tool itself was only slightly useful.
Is there anything else to know about how this option works? what happens if you also provide --yaml-stream
?
And finally, would it make sense to have addition commandline option & behavior documentation here in the repo? either the top-level README.md
or possibly within a docs
directory?