iomentum / cargo-scaffold

cargo scaffold lets you scaffold and generate projects described in a simple TOML file
MIT License
57 stars 12 forks source link

Support for using `parameters` inside hooks #53

Closed gabhijit closed 6 months ago

gabhijit commented 7 months ago

This PR adds support for using the scaffold parameters inside hooks. For example let's say you have a parameter like tutorial_name with a value foo.

You could use it as follows in hooks (in .scaffold.toml)

[hooks]
pre = [ "mkdir {{tutorial_name}}" ]

Which is often quite useful where you may want to use some shell commands based on the values given to the scaffold as options.