Skip to main content

run_hook

Function run_hook 

Source
pub async fn run_hook<C: Serialize>(
    extensions: &[ResolvedExtension],
    hook: HookName,
    context: &C,
    printer: &Print,
)
Expand description

Runs a single lifecycle hook across all registered extensions.

For each extension whose manifest lists hook, spawns stellar-scaffold-<name> <hook> as a subprocess, serializes context as JSON to its stdin, waits for it to exit, then forwards its stdout to Scaffold’s own stdout.

Non-zero exits are logged as errors but do not abort the loop — all extensions are given a chance to run regardless of whether an earlier one failed. The function itself is infallible from the caller’s perspective.