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
684 stars 31 forks source link

fix: fix execute permission not applied to hooks on linux machines #25

Closed donalfenwick closed 2 years ago

donalfenwick commented 2 years ago

During an install on a linux system a chmod +x command needs to be applied to each hook by the SetExecutablePermission method. The call to Directory.GetFiles(path).Where(f => !f.Contains(".")) was ignoring any hooks in the husky dir as it was getting the full path and file name for each file. The full path included a dot in the parent folder name /.husky causing the file to be skipped. This change inspects only the file name to ensure the hooks are included in the call to SetExecutablePermission.

Type of change

alirezanet commented 2 years ago

Thanks! 👌