Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Init/Pre/Post Scripts

cargo-generate can run scripts in the Rhai language as part of the template expansion.

Doing so requires the template is configured to use hooks, which can be used at specific times during template expansion.

To configure the use of hooks, write a hooks section in the cargo-generate.toml file.

[hooks]
init = ["init-script.rhai"]
pre = ["pre-script.rhai"]
post = ["post-script.rhai"]