alirezanet / Husky.Net

Git hooks made easy with Husky.Net internal task runner! 🐶 It brings the dev-dependency concept to the .NET world!
https://alirezanet.github.io/Husky.Net/
MIT License
632 stars 29 forks source link

not working on repos that haven't run dotnet husky install #101

Closed talbananaz closed 5 months ago

talbananaz commented 5 months ago

Version

latest

Details

Husky dotnet is not working with error unable to find git (or something along that manner) unless a user actually manually writes dotnet husky install (even though others have done this and pushed to the repo).

I assume this is due to .git folder not being in version control which is where the precommit hooks are written to, but is there a way for this to actually setup automatically? Its very odd to me that each user will need to setup husky locally unless I'm missing something and git folder shouldn't be in version control from my knowledge.

Steps to reproduce

install husky dotnet with precommit hooks in a repo on one computer download the repo and try command:

dotnet husky run

alirezanet commented 5 months ago

Hi @talbananaz,

Have you attached Husky to your project? To install Husky for other users (or the first use after cloning the repo), you need to link the dotnet husky install command to one of your projects. The install command is always necessary, and it's up to you to configure it on your repo to make it easier for other users. By attaching it to one of your projects, if you build the app, Husky will also be configured automatically.

https://alirezanet.github.io/Husky.Net/guide/automate.html

For example, if you download this repo and build the project, Husky is automatically activated on your machine.

talbananaz commented 5 months ago

Thanks, looks good, will test :)