dwyl / elixir-pre-commit

✅ Pre-commit hooks for Elixir projects
GNU General Public License v2.0
46 stars 10 forks source link

Pre-existing pre-commit hooks are overwritten #8

Open finnhodgkin opened 6 years ago

finnhodgkin commented 6 years ago

I'm not sure how we can work around our script overwriting existing pre-commit hooks, but I thought it worth opening this issue for ideas and discussion :blush:

secondspass commented 6 years ago

How about doing this: check if there is already a precommit hook file present. If no, then proceed as it is being done now. If yes, then create a new file with the mix pre_commit command in it, append a command in the original precommit hook file calling our new file.

This way we won't have to overwrite the old file.