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

Aliasadidev add support for custom args #70

Closed aliasadidev closed 1 year ago

aliasadidev commented 1 year ago

Description

Currently, there is no option on ArgumentParser class to create an ArgumentInfo that supports both AddCustomArgument and AddStaticArgument in one Args, I added this option.

 {
      "name": "Run JB Clean Up Code",
      "command": "cmd",
      "pathMode": "relative",
      "args": [
        "/c",
        "dotnet",
        "jb",
        "cleanupcode",
        "proj.sln",
        "--profile=Team: Full Cleanup",
        "--include=${args}" <======= added for this usage.
      ],
      "group": "pre-commit"
    }
switch (arg.ToLower().Trim())
{
 case "${args}":
    AddCustomArguments(args, optionArguments);
    break;
 case var value when value.Contains("${args}") && optionArguments is not null && optionArguments.Any():
   args.Add(new ArgumentInfo(ArgumentTypes.Static, value.Replace("${args}", string.Join(' ', optionArguments!))));
   break;
 case "${last-commit}":
//...

Type of change

Checklist

aliasadidev commented 1 year ago

@alirezanet Hi, Please let me know when you publish it on Nuget, I want to use that on the pipeline. Thanks. :)

alirezanet commented 1 year ago

@alirezanet Hi, Please let me know when you publish it on Nuget, I want to use that on the pipeline. Thanks. :)

It is available in 0.6.0-Preview2.