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

Can not find task-runner.json when running dotnet husky run on Windows #75

Closed rafaelxvr closed 1 year ago

rafaelxvr commented 1 year ago

Version

v0.5.4

Details

Hello, i'm trying to set up Husky.NET on a new project (.NET Core 6).

When running dotnet husky run keeps returning the error [Husky] ?? Loading tasks ... Can not find task-runner.json, try 'husky install'

When i run the following commands, i get the correct paths:

`// Git Repo Path git rev-parse --show-toplevel // returns the repo path

// Husky Relative Path git config --get core.hooksPath // returns the .husky folder`

Already uninstalled and installed, but keeps getting the same error.

Steps to reproduce

On Windows 10 dotnet husky install dotnet husky run

Get error saying "Can not find task-runner.json"

alirezanet commented 1 year ago

Hi @rafaelxvr,

Well you repo and husky path looks ok, do you have the task-runner.json file in the .husky folder?

rafaelxvr commented 1 year ago

Hi @alirezanet, i do have the task-runner.json inside the .husky folder, created by following the Get Started guide on documentation. Was created by the installation itself.

alirezanet commented 1 year ago

We are using this library on multiple different projects and never seen this behavior before... might be related to your git configuration or Paths!, can you try running everything with the -v option? you might get more details about the error.

rafaelxvr commented 1 year ago

Which commands exactly @alirezanet ? the git ones?

alirezanet commented 1 year ago

dotnet husky install -v and dotnet husky run -v

image

rafaelxvr commented 1 year ago

image image

Same thing, did all steps again

alirezanet commented 1 year ago

Hi @rafaelxvr,

This is weird! it should work but apparently, it doesn't work for you for some reason. the way we can find the problem is to either wait for the next version and let me add more verbose logs to each install steps or try to run the husky in debug mode to find what is wrong. on my machines it is working so I can not reproduce the problem.

alirezanet commented 1 year ago

I published a new preview version with more logs, can you please try using 0.6.0-Preview4 version?

dotnet tool update Husky --version 0.6.0-Preview4
rafaelxvr commented 1 year ago

Got the problem @alirezanet, its all about special characters:

image

The symbol in question is "ó", on the word Repositório which means repository in portuguese. :)

Thank you so much for you time! @alirezanet Maybe this is something you can consider to fix! Or to documentate.