the "${staged}" arg only returns empty #91
-
Beta Was this translation helpful? Give feedback.
Replies: 3 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.
-
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 |
Beta Was this translation helpful? Give feedback.
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:
So basically we don't need
bash -c