captain-hook

Crates.iocaptain-hook
lib.rscaptain-hook
version0.2.2
sourcesrc
created_at2021-08-11 16:46:14.748803
updated_at2022-01-07 00:50:41.512837
descriptionCross-platform, modern and native git hooks.
homepage
repositoryhttps://github.com/fdionisi/captain-hook/
max_upload_size
id434862
size402,781
Federico Dionisi (fdionisi)

documentation

README

Captain Hook 🪝

Cross-platform, modern and native git hooks.

Built on top of husky.

Abstract

Husky is a great tool, but it requires Node.js to be installed. This requirement may prevent developers from using it on a project that does not use Node.js. This implementation aims to provide an executable that can be used in any git project despite the language or runtime available. The coding philosophy is to avoid dependencies to keep the size of the binary to a minimum, making it a CLI application that is accessible to anyone.

Notes

  • Upgrading from 0.1.* to 0.2.0 involves breaking changes.

    Version 0.2.0 is built on top of husky and follows its files and directories naming convention.

    During the install command, by default Captain Hook places all files in the .husky directory rather than the .hooks. The boot script for each hook is now called _/husky.sh instead of _/captain-hook.sh. Consequently, during the add command, the new hook will be prefixed with . "$(dirname "$0")/_/husky.sh".

Prerequisites

To run captain-hook you need to have git installed on your machine.

Quick Install

It is possible to install captain-hook in two flavours:

  • With Shell:

    sh -c "$(curl -fsSL https://captain-hook.sh/install)"
    

    To update the Captain Hook itself, rerun the above script. It will replace the current version with the latest one.

  • With Cargo:

    cargo install captain-hook
    

    To update the Captain Hook with Cargo, remember to force re-installing the binary.

    cargo install -f captain-hook
    

License

Captain Hook is distributed under the terms of the MIT license.

See LICENSE for details.

Commit count: 31

cargo fmt