Processing files and folders in-place #1400
-
Hello, We found gomplate as a great alternative for We also found that we may process files and folders in-place:
And we have some questions related to this
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @air3ijai, thanks for the questions - I've converted this to a Discussion since it does not appear to be a bug report or feature request.
In general, it should be safe - gomplate reads the contents of each template into memory before rendering it, so the output file won't be written until after the input is read. Obviously, if you're processing a file in-place, it will be modified - that may not be considered "safe".
No. It's pretty rare to do this as generally folks don't want templates to be modified, so I don't think it makes sense to add this as an implicit capability. But specifying the same file/dir for in/out works, so you can continue to do that. Let me know if you have any other questions about this - hope this helped! |
Beta Was this translation helpful? Give feedback.
-
@hairyhenderson, thank you for moving that - will consider this for future questions. We have a lot of stuff like
and a simple alternative like this, looks very good
In our case we don't need to store template separately and manifests should be updated in-place, right before apply.
But for our case a solution like this, will replace a tens of commands
Maybe someone else will ask same approach and you will consider a kind of Thank you for your work, Dave! |
Beta Was this translation helpful? Give feedback.
Hi @air3ijai, thanks for the questions - I've converted this to a Discussion since it does not appear to be a bug report or feature request.
In general, it should be safe - gomplate reads the contents of each template into memory before rendering it, so the output file won't be written until after the input is read. Obviously, if you're processing a file in-place, it will be modified - that may not be considered "safe".
No. It's pretty rare to do this as generally folks don't want templates to be modified, so I don't think it makes sense to add this a…