stevegrunwell / smee

ABANDONED: Please use https://github.com/BrainMaestro/composer-git-hooks instead! Library for automatically copying Git hooks into a project.
MIT License
2 stars 0 forks source link

Alert users when a hook already exists #13

Closed stevegrunwell closed 6 years ago

stevegrunwell commented 6 years ago

This PR was originally meant to be a solution for #1, but in the interest of keeping the scope low I'm going to bump #1 from the 1.0.0 milestone.

What this branch does do, however, is detect conflicts between hooks that should be copied and those that might already exist. When this happens, the user will be prompted how they wish to handle the conflict: skip the new hook, overwrite the existing hook, or show a diff between the two (followed by a prompt to skip or overwrite).

This PR also handles exceptions that may come up during the copying of a single hook, with logic that enables the process to resume where it left off.

63a4f53, contained within this commit, also fixes #9.