Skip to content

Commit

Permalink
docs: bash
Browse files Browse the repository at this point in the history
  • Loading branch information
typicode committed Mar 9, 2024
1 parent ad6f0b3 commit 0a54124
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/how-to.md
Expand Up @@ -157,6 +157,21 @@ In order to run scripts that require the use of a scripting language, use the fo
// ...
```

## Bash

Hook scripts need to be POSIX compliant to ensure best compatibility as not everyone has `bash` (e.g. Windows users).

That being said, if your team doesn't use Windows, you can use Bash this way:

```shell
# .husky/pre-commit

bash << EOF
# Put your bash script inside
# ...
EOF
```

## 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 0a54124

Please sign in to comment.