From 1bbb9228d95bdaf907e72460356fbd89c7b3e2c6 Mon Sep 17 00:00:00 2001 From: Kordrad Date: Wed, 14 Feb 2024 00:03:56 +0100 Subject: [PATCH] docs: info about adding a new hook (#1389) description is taken from https://github.com/typicode/husky/releases/tag/v9.0.1 --- docs/how-to.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/how-to.md b/docs/how-to.md index ef28ced4a..1dd46aa00 100644 --- a/docs/how-to.md +++ b/docs/how-to.md @@ -1,5 +1,12 @@ # How To +## Adding a New Hook + +Adding a hook is as simple as creating a file. This can be accomplished using your favorite editor, a script or a basic echo command. For example, on Linux/macOS: +```shell +echo "npm test" > .husky/pre-commit +``` + ## Startup files Husky allows you to execute local commands before running hooks. It reads commands from these files: