Function install_self_as_hook

Source
pub fn install_self_as_hook(project_root: impl AsRef<Path>) -> Result<()>
Expand description

Copies the std::env::current_exe() file to ${project_root}/.git/hooks/pre-commit That’s all you need to register a git pre-commit hook.

It will silently overwrite the existing git pre-commit hook.