dwyl / elixir-pre-commit

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

Check for .git directory before attempting copy #10

Closed finnhodgkin closed 6 years ago

finnhodgkin commented 6 years ago

At the mo when our module is loaded it copies priv/pre-commit to the parent module's .git/hooks directory. Sometimes the parent module might not be an initialised .git repo, or it could be a subfolder of an initialised repo. Two solutions to this:

  1. Run a check to see if the .git folder exists before copying - if it doesn't IO.puts an error message.
  2. Add the above, but also add an optional second config variable that points to the absolute path of the correct .git/hooks.
finnhodgkin commented 6 years ago

Closed by #28