Skip to main content

Module hooks

Module hooks 

Source
Expand description

Hook execution for sr lifecycle events.

Runs configured shell commands at sr lifecycle boundaries (pre/post for each command). Hook context is passed as JSON via stdin so commands can act on structured data (event name, version, files, etc).

Structs§

HookContext
Context passed to hook commands as JSON on stdin.

Functions§

run_event
Run all commands for a lifecycle event.
run_shell
Run a shell command (sh -c), optionally piping data to stdin and/or injecting environment variables. Returns an error if the command exits non-zero.