tmrts / boilr

:zap: boilerplate template manager that generates files or directories from template repositories
Apache License 2.0
1.73k stars 119 forks source link

shadow some iteration variables for closures #66

Closed loderunner closed 3 years ago

loderunner commented 6 years ago

This fixes an issue where calling boilr template use with --use-defaults or -f. All project variables were set to the last default variable.

The iteration variable v was captured inside a closure and all closures ended up pointing to the same string. This fix uses shadowing to create a local copy of the pointer variable to be captured in the closure.