captainhookphp / captainhook

CaptainHook is a very flexible git hook manager for software developers that makes sharing git hooks with your team a breeze.
http://captainhook.info
MIT License
996 stars 86 forks source link

Fix commit issues on missing /dev/tty #229

Closed hoogi91 closed 11 months ago

hoogi91 commented 11 months ago

This fixes an issue encountered during committing on WSL2 with PHPStorm. The message was: .git/hooks/prepare-commit-msg: 2: cannot open /dev/tty: No such device or address

Committing directly from WSL works but it looks like the execution step of PHPStorm breaks the behavior at that point. The PR adds a check if /dev/tty exists before using it.