kreuzwerker/envplate

Add output file option?

simonvanderveldt opened this issue · 5 comments

Hello Kreuzwerker team,

First of all thanks for the nice and simple tool! :)

I want to ask you guys for your opinion on something:
I'm using envplate for some of my personal projects and for one of them I use one Docker image which I volume mount a different config in depending on what I want to use the container for. This config contains a couple of variables that I want to template using envplate. Each of the configs gets used multiple times but with different values.
Since I mount these into the container running envplate on them changes the actual file on the host :P

I'm wondering what you guys think about this and if it would a reasonable addition to envplate.
Obvious workaround is to volume mount to a different filename and do a cp first (or to create multiple images with the config built into them)

yawn commented

I think it's reasonable. Do you want to submit a PR?

👍

It nice to have this. or make -d options output to stdout rather than output to stderr.
Here is my PR

yawn commented

I've released a RC for 1.0.0. Feel free to test and close if this fixes your issue. And thanks for contributing!

yawn commented

Ping @RustJason

it'd be also great if envplate would read from stdin:

cat templates/foo.conf | ep -d > /etc/foo.conf

however, -d seems redundant in this case.