Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a mechanism to source project-specific scripts before executing any of the git hook scripts managed by Husky.
Rationale
As stated in this comment ( #385 (comment) ), some times is necessary to apply the
exec < /dev/ttytrick before reaching the point where we execute any NodeJS-related tool (in my specific case, because those tools are containerized).Although it's possible to achieve that by using the
~/.huskyrcfile, using this solution forces all developers in a project to customize their development environments, when, precisely, tools such asnvm, or in my specific caseavatar-cli, are designed to ease the creation of more homogeneous development environments.Regarding why the file
.huskyhookfile is loaded before~/.huskyrc, I assumed that, whatever customization the developer has in its environment, it's probably there because she wants to override something, so I tried to preserve that.Regarding the name of the file, I'm not attached to it, we could pick something else. I just wanted to use a name different than
.huskyrcbecause that name has a different meaning when it's inside a project (Actually I find quite unfortunate that the same name is used for so different concepts: script and configuration).Related to issue #385 .