bluebrown / go-template-cli

render json, yaml & toml with go templates, from the command line
BSD Zero Clause License
31 stars 7 forks source link

support merging yaml files from STDIN #24

Open rriemann opened 2 months ago

rriemann commented 2 months ago

Dear Nico,

one more idea I would like to raise.

I thought of this use case:

cat /env/default/values.yaml /env/production/values.yaml | tpl -d yaml -f template.gotmpl

At the moment, it seems only the second yaml input file is considered if both files are delimited with --- and .... Would it be possible to join them?

bluebrown commented 2 months ago

Hi, I think this may be out of scope, given, you can use another tool like yq to merge the file before invoking tpl. So it would follow the unix philosophy.

However, I don't have very strong feeling on this. Do you have any suggestion how to implement this or do you want make a PR?