the "${staged}" arg only returns empty #91
Replies: 2 comments 1 reply
-
Hi @foxmcloud555, git diff --staged --name-only --no-ext-diff --diff-filter=AM I did test this task and it works as expected: {
"name": "echo staged files",
"pathMode": "absolute",
"command": "cmd",
"group": "pre-commit",
"args": [ "/c", "echo", "${staged}"],
} pre-commit:
|
Beta Was this translation helpful? Give feedback.
-
Thanks for looking at this! I just got set up on a windows device to check for you, and everything works just fine. It echos the staged files with no issue. Also, the output of that git command is exactly as you'd expect on both devices, mac and windows. I'll clone the actual husky repo today and see if I can run through. |
Beta Was this translation helpful? Give feedback.
-
Just setting up Husky across a team project right now, and I'm apparently struggling to use the args in the task runner.
I have doubled checked both with and without staged files to see if anything changed, it didn't make a difference.
Here's my task-runner.json:
And here's my terminal output on
dotnet husky run
If I don't use the --include, inspectcode runs as normal and the output is as expected.
I am on an M1 mac, I know some dotnet tools are currently a bit funky with arm arch but everything aside from this seems fine so far.
There is a submodule present, but currently i'm in the parent repo.
I've tried with a fresh clone of this repo in a new location just to make sure, and I've had a look through and nothing looks out of the ordinary. Hooks are triggered as you'd expect, so the pre-commit group do actually run on commit, etc.
It's just this specific variable thats always empty.
I would greatly appreciate any help.
Beta Was this translation helpful? Give feedback.
All reactions