/git-hooks-scripts

Run custom scripts as Git hooks

Primary LanguageJavaScriptMIT LicenseMIT

git-hooks-scripts

Version MIT License

Run custom scripts as Git hooks.

Installation

npm install --save-dev git-hooks-scripts

Usage

Add your scripts under a section called git-hooks-scripts in your package.json file:

"git-hooks-scripts": {
  "pre-commit": "eslint ."
}

You can also get arguments from Git via the GIT_HOOKS_PARAMS environment variable. For example, to setup commitlint, you can do the following:

"git-hooks-scripts": {
  "commit-msg": "commitlint -E GIT_HOOKS_PARAMS"
}