Skip to main content

run_event

Function run_event 

Source
pub fn run_event(event: &str, cwd: &Path) -> Result<()>
Expand description

Run the configured hook for event (one of "post_new", "pre_rm"), resolving the hook command from the layered config rooted at the main repo (resolved from cwd via git::get_main_repo_root, falling back to cwd if that fails). The hook runs with cwd as its working directory.

No-op (returns Ok(())) when the event name is unknown or the hook is unset. Hook is run as sh -c <cmd>. A non-zero exit propagates as CwError::Other.