pub fn execute_hook(
event: HookEvent,
unit: &Unit,
project_dir: &Path,
reason: Option<String>,
) -> Result<bool, Error>Expand description
Execute a hook script with the given payload.
§Arguments
event- The hook event to triggerunit- The unit to pass to the hookproject_dir- The project root directory (parent of .mana/)reason- Optional reason (used for pre-close hooks)
§Returns
Ok(true)- Hook passed (exit 0), or hook doesn’t exist, or hooks not trustedOk(false)- Hook executed but returned non-zero exit codeErr- Hook exists but not executable, timeout, or I/O error