Skip to main content

Module hooks

Module hooks 

Source
Expand description

Lifecycle hooks executed by gw at key worktree transitions.

Configured via hooks.post_new / hooks.pre_rm keys in ~/.config/git-worktree-manager/config.json or .cwconfig.json.

Functionsยง

run_event
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.