boilerplate
boilerplate copied to clipboard
Add support for callbacks
To make boilerplate
even more flexible and powerful, it would be great to support "callbacks" where you can provide arbitrary code to execute at specific times. For example, there could be a start
callback that gets called just after Boilerplate gathers all variables but before it starts generating; a file
callback called for each file and folder Boilerplate processes; and an end
callback called after project generation is finished. The callbacks could be defined as simple shell commands in boilerplate.yml
:
variables:
- name: foo
- name: bar
callbacks:
start: echo "Boilerplate is generating files to $2 from templates in $1"
file: echo "Boilerplate is processing file $1"
end: echo "Boilerplate finished generating files in $2 from templates in $1"