1.1.0 • Published 3 years ago

captain-githook v1.1.0

Weekly downloads
5
License
MIT
Repository
github
Last release
3 years ago

captain-githook

Install

npm install --save-dev captain-githook

Usage

Install this module to your repository, and put any repository-wide hooks in ./.githooks. You'll now be able to commit and share these hooks. Each of the hooks in ./.githooks must be executable and may only be a file with no extension, named after the hook it should run on. These can be used to run multiple other scripts or not, the choice is yours. There are some example hooks in the example-hooks directory of this repository.

How?

Upon install, this module will run a postinstall hook. This moves any existing hooks you may have into .git/hooks/local, and symlinks .git/hooks/shared to ./.githooks. Git hook hardlinks are then created pointing to split-hook.js, which when called will look first for the name of the called hook in local and run if present, and then do the same for a shared hook.

Why?

Initially created for my own pre-commit linting, but found to be useful in bigger teams to enforce code guidelines before any code makes it up to the repository.

Uninstall

There is an uninstall task which can be run, this clears up the .git/hooks directory, but leaves the ./.githooks directory intact. This allows you to easily switch to another githook management tool without clearing up manually.

1.1.0

3 years ago

1.0.10

4 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.0.14

8 years ago

0.0.13

8 years ago

0.0.12

8 years ago

0.0.11

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago

0.0.0

8 years ago