Closed MarkusGnigler closed 1 year ago
Hi @MarkusGnigler,
I reproduced your example and it worked as expected. 🤔
are you sure you didn't miss anything in your example?
Thanks for reply.
Strange. I play a little and try with powershell and wsl-debian. It looks like the runner couldn't use the staged variable i guess?
The following command runs fine
dotnet husky exec .husky/test.csx --args arg1 arg2
and dotnet husky run
get a exec error .
Please can you share your task in task-runner.json
, could be that i messed up something there.
This is exactly your example:
🤷♂️
It might be related the terminal you are using, can you try PowerShell if you're using something else? it should work for you. I tested on two different machines with two different OS, didn't face this problem
Sorry for the unnecessary disturbance! I don't know the root causes but seems to be that my company PC is to hard restricted. It work's on my private PC as expected.
Hi @alastair-todd, Why are you returning 1 if you don't expect an error? any non-zero exit code is considered an error. in that example I was expecting an error.
Version
v0.5.4
Details
I want format my code with only staged files, so i test the ${staged} variable with an c# script for this. If i change
${staged}
to some hardcoded values e.g."arg1"
it works as expected.When i run husky i got following errors:
A simple echo task works fine but every arg to another command won't.
:heavy_check_mark:
:x:
Steps to reproduce
.husky/test.csx
to print the args.husky/task-runner.json