the "${staged}" arg only returns empty #91
Replies: 3 comments 1 reply
|
Hi @foxmcloud555, git diff --staged --name-only --no-ext-diff --diff-filter=AMI 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: |
|
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. |
|
Today, I encountered the same issue on my Linux machine. To echo staged files in Linux, and likely on Mac as well, you should define the task as follows: {
"tasks": [
{
"name": "Test",
"command": "echo",
"args": [ "${staged}" ]
}
]
}So basically we don't need |


Today, I encountered the same issue on my Linux machine. To echo staged files in Linux, and likely on Mac as well, you should define the task as follows:
{ "tasks": [ { "name": "Test", "command": "echo", "args": [ "${staged}" ] } ] }So basically we don't need
bash -c