Skip to main content

run_hook_install

Function run_hook_install 

Source
pub fn run_hook_install(path: &Path, yes: bool) -> Result<i32>
Expand description

Install the timebomb pre-commit hook.

  • If the hook already contains the timebomb block, prints a message and exits 0.
  • If the hook file does not exist, creates it with a shebang + hook block.
  • If the hook file exists but has no timebomb block, appends the block.
  • When yes is false the user is prompted before any write.