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

Doesn't support the dotnet tools (e.g jb) #68

Closed aliasadidev closed 1 year ago

aliasadidev commented 1 year ago

Version

0.5.4

Details

I've installed jb tool with dotnet cli, the husky tool added a dash between dotnet and tool name; for this reason, the execution failed.

dotnet config file

{
  "version": 1,
  "isRoot": false,
  "tools": {
    "jetbrains.resharper.globaltools": {
      "version": "2022.3.2",
      "commands": [
        "jb"
      ]
    },
    "husky": {
      "version": "0.5.4",
      "commands": [
        "husky"
      ]
    }
  }
}

husky's runner task

 {
      "name": "Run JB Clean Up Code",
      "command": "dotnet",
      "args": [
        "jb cleanupcode myproj.sln --profile='proj: Full Cleanup'"
      ],
      "group": "pre-commit",
      "cwd": "."
    }

image

Steps to reproduce

alirezanet commented 1 year ago

Hi @aliasadidev, I'll take a look deeper into why this is happening, but if you separate your arguments it will work correctly, this is the default behavior probably for difference in parsing arguments for Linux, Windows, and Mac terminals.

 "command": "dotnet",
 "args": [ "jb",  "cleanupcode",  "myproj.sln --profile='proj: Full Cleanup'" ]

Let me know if this haven't solved your problem.

aliasadidev commented 1 year ago

@alirezanet Thanks it works, I guess it would be great to mention it in documents or in the real sample.

alirezanet commented 1 year ago

Happy to hear that it worked, thanks for the feedback, also pull requests are welcome 😉😊