Skip to content

Commit

Permalink
fix #1366 Update how-to.md (#1384)
Browse files Browse the repository at this point in the history
Fix #1366 by adding documentation to `how-to.md`
  • Loading branch information
gcko committed Feb 14, 2024
1 parent 1bbb922 commit f031ca8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/how-to.md
Expand Up @@ -138,6 +138,25 @@ cd frontend
npm test
```

## Non-shell hooks

In order to run scripts that require the use of a scripting language, use the following pattern for each applicable hook:

(Example using hook `pre-commit` and NodeJS)
1. Create an entrypoint for the hook:
```shell
.husky/pre-commit
```
2. In the file add the following
```shell
node .husky/pre-commit.js
```
3. in `.husky/pre-commit.js`
```javascript
// Your NodeJS code
// ...
```

## Node Version Managers and GUIs

If you're using Git hooks in GUIs with Node installed via a version manager (like `nvm`, `n`, `fnm`, `asdf`, `volta`, etc...), you might face a `command not found` error due to `PATH` environment variable issues.
Expand Down

0 comments on commit f031ca8

Please sign in to comment.