commitizen / cz-cli

The commitizen command line utility. #BlackLivesMatter
http://commitizen.github.io/cz-cli/
MIT License
16.63k stars 552 forks source link

exec < /dev/tty && make an error? #636

Open zzzgit opened 5 years ago

zzzgit commented 5 years ago
module.exports = {
    "hooks": {
        // "prepare-commit-msg": "echo foooooo", // it works
               "prepare-commit-msg": "exec < /dev/tty && echo foooooo", 
    }
}

With the config above in .huskyrc.js, I will get an error in console:

husky > prepare-commit-msg (node v10.11.0)
The system cannot find the path specified.
husky > prepare-commit-msg hook failed (cannot be bypassed with --no-verify due to Git specs)

What's the cause?

sadsa commented 4 years ago

What is your development environment? i.e. OS etc. I know for a fact the Windows cannot execute this command.

Classic-Paterson commented 4 years ago

What is your development environment? i.e. OS etc. I know for a fact the Windows cannot execute this command.

Can confirm this.

zzzgit commented 4 years ago

What is your development environment? i.e. OS etc. I know for a fact the Windows cannot execute this command.

windows 7 git terminal

Classic-Paterson commented 4 years ago

The hook is written in bash - you either need to install the windows subsystem for linuc (WSL), or follow the later comments on this post https://github.com/commitizen/cz-cli/issues/627 which creates a batch file for you to run it (note that this was done on windows 10).