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

Husky exec can't find file or assembly in cache #58

Closed Daniele-Tentoni closed 1 year ago

Daniele-Tentoni commented 1 year ago

Version

0.5.3

Details

I've installed husky commit-msg hook as example:

#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
dotnet husky run --name "commit-message-linter" --args "$1"

And task in task-runner.json is:

{
     "name": "commit-message-linter",
     "command": "dotnet",
     "args": ["husky", "exec", ".husky/csx/commit-lint.csx", "--args", "${args}"]
},

But when it runs it say me:

Could not load file or assembly 'C:\...\.husky\_\cache\4D72B7ADBD7784997E1BB84765FAAEB70E0070C7CDCC0CD5A26506CEE37777A324ECB98D7D0485C05D1739A944786193B1E96A9026E5F636C8BF952157B5ECBC'. Impossibile trovare il modulo specificato.

(read as "Impossible to find the specified module)

The content of that file is cryptic for me.

Steps to reproduce

Follow this guide on official site https://alirezanet.github.io/Husky.Net/guide/csharp-script.html#examples and try to commit using a convential commit compilant commit message as build: ok.

alirezanet commented 1 year ago

Hi @Daniele-Tentoni,

It looks like you are experiencing an issue with Net7.0 due to some breaking changes. As a result, I have excluded version 0.5.3 from releases for now. I recommend downgrading to version 0.5.2 until I release the next stable version. Please let me know if you have any further questions or need additional assistance.

uheee commented 1 year ago

Hi @Daniele-Tentoni,

It looks like you are experiencing an issue with Net7.0 due to some breaking changes. As a result, I have excluded version 0.5.3 from releases for now. I recommend downgrading to version 0.5.2 until I release the next stable version. Please let me know if you have any further questions or need additional assistance.

I downgraded my husky to 0.5.2, but it says Unable to execute cached script when I exec dotnet husky exec .husky\csx\commit-lint.csx -v although I have used dotnet husky clean.

alirezanet commented 1 year ago

Hi @uheee Downgrading Dotnet tools sometimes is a little bit tricky, can you please double-check and confirm that you are using the 0.5.2 version using this dotnet husky --version command?

PS. Since we're using version 0.5.2 in a lot of projects I'm pretty sure that it is working fine.

uheee commented 1 year ago

@alirezanet The echo is v0.5.2.

alirezanet commented 1 year ago

The issue must have been solved in v0.5.4.

Daniele-Tentoni commented 1 year ago

Hello @alirezanet , sorry for the delay.

Everything is working fine now, thank you for the great work with this tool!