gruntwork-io / boilerplate

A tool for generating files and folders ("boilerplate") from a set of templates
https://www.gruntwork.io
183 stars 16 forks source link

Variable references #35

Closed brikis98 closed 7 years ago

brikis98 commented 7 years ago

In #34, I added the ability for boilerplate variables to use Go templating syntax in their default value. The main use case for this was to be able to reuse values from other boilerplate variables. This works fine for strings, but the issue is if you want to reference another variable with a non-string type (e.g. list), the templating syntax doesn’t help, as it always returns a string.

The best solution I can come up with for now is to add support for a new reference keyword that allows you to specify that one variable should use the value of another variable. That value can be of any type.

brikis98 commented 7 years ago

Merging. Feedback welcome.