cz-cli
cz-cli copied to clipboard
/dev/tty: command not found
Hello, I added "exec < /dev/tty && node_modules/.bin/cz --hook || true" to prepare-commit-msg hook and checked git commit and everything works fine. but when I want to use commitizen vscode extension I get "/dev/tty: command not found" error
Also happens from VSCode when you try to make a commit from the source control functionality
Following this SO question y modified prepare-commit-hook to:
tty="$(readlink /proc/$$/fd/2)"; [ "$tty" = "/dev/pts/1" ] && (exec < /dev/tty && node_modules/.bin/cz --hook) || true
And the result is:
git commitfrom terminal works as expected.- Commit form VSCode (manual message):
- With message
test, it fails. :point_right: ok - With message
feat: test, it works! :point_right: ok
- With message
I don't know if it will work with other action (like cherry pick, etc) but it's better than nothing :grimacing: