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

Customize Staged variable separator #99

Closed alirezanet closed 6 months ago

alirezanet commented 7 months ago

Discussed in https://github.com/alirezanet/Husky.Net/discussions/98

Originally posted by **AlaiyaNetwork** December 4, 2023 I add this task ``` { "name": "Clean up code", "group": "clean-up-code", "command": "cmd", "pathMode": "relative", "args": [ "/c", "dotnet", "jb", "cleanupcode", "My.sln", "--profile=Teams: Clean up code", "--settings=My.sln.DotSettings", "--include=${stages-files}" ] } ``` And variables: ``` { "name": "stages-files", "command": "cmd", "args": [ "/c", "git diff --staged --name-only --no-ext-diff --diff-filter=AM | tr '\\n' ';' | sed 's/;$//'" ] } ``` If I commited none *.cs files: ``` [Husky] Preparing task 'Clean up code' [Husky] Executing task 'Clean up code' ... JetBrains Cleanup Code 2023.3 RC 1 Running on x64 OS in x64 architecture, .NET 8.0.0 under Microsoft Windows 10.0.22631 No items were found to cleanup. ❌ Task 'Clean up code' failed in 16 864ms husky - pre-commit hook exited with code 1 (error) ``` Maybe someone has already had this problem and can suggest a good solution?
alirezanet commented 6 months ago

Fixed in v0.6.4