Closed sayowayah closed 2 years ago
Hi @sayowayah, What is the output of these two git commands on your Windows PC?
// Git Repo Path
git rev-parse --show-toplevel
// Husky Relative Path
git config --get core.hooksPath
I think your problem is related to git installation. loading the task-runner.json is simply a combination of these two commands (line 36): https://github.com/alirezanet/Husky.Net/blob/14d5a9abdbf48639ea81e2eee85bbe2324f03252/src/Husky/TaskRunner/HuskyTaskLoader.cs#L33-L40
Ah, thank you @alirezanet that helped! Turns out the directory structure wasn't a problem. It was an issue with my teammates using Chinese folder names which apparently Path.Combine
does not like.
Ah, thank you @alirezanet that helped! Turns out the directory structure wasn't a problem. It was an issue with my teammates using Chinese folder names which apparently
Path.Combine
does not like.
Interesting... If you know any solution to support the Chinese language let me know. I'm not sure why Path.Combine
doesn't work in this case! or I close the issue.
thanks
Version
0.4.2
Details
Hello! I have Husky.Net set up working great on my Mac with VS Code. However, my teammates using Visual Studio 2022 on Windows can't get our pre-commit hooks to work.
When I try
dotnet husky run
from PowerShell on Windows, I get an error message saying "Can not find task-runner.json" even though the file is there right next to pre-commit in the .husky folder. I've trieddotnet husky uninstall
thendotnet husky install
thendotnet huksy run
with the defaulttask-runner.json
contents and get the same error.My directory setup is a solution with multiple projects in their own folders. Husky.NET's .husky folder is at the root. My dotnet commands are all run from the root directory.
Any ideas? Thanks!
Steps to reproduce
On Windows 10
dotnet husky install
dotnet husky run
Get error saying "Can not find task-runner.json"