mirror of
https://github.com/hanzoai/husky.git
synced 2026-09-24 16:59:45 +00:00
docs: bash (#1404)
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user