-
-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ripgrep returns exit code 1 with no stdout or stderr, can't work out why #190
Comments
Hi Dan. This appears to be happening because You can reproduce this behavior in the terminal like so: c:\Users\Tyrrr\Downloads\1>echo "foo rabbit bar" | rg rabbit
"foo rabbit bar" CliWrap always redirects all standard streams and handles piping at a separate layer, so that's why the stdin is redirected even though you didn't pipe anything there. If the stdin is empty (which is the default), Anyway, to fix this, you need to override var result = await Cli.Wrap("rg")
.WithArguments(new[] {
"rabbit",
"."
}, false)
.WithWorkingDirectory(@"C:\Dump\GrepTest\")
.WithValidation(CommandResultValidation.None)
.ExecuteBufferedAsync();
result.Dump() |
HI @Tyrrrz. Thank you so much for looking into that, and for your very detailed reply! Especially as it involved a different tool that you're not involved in 🙏🏼 |
You're welcome! |
Version
3.6.0
Details
I'm trying to use this to run Ripgrep, but it always returned errorcode 1 with nothing in the stdout. Not sure why.
Steps to reproduce
Here's an example...
On the left, I'm trying to run
rg rabbit
, and it fails with no reason. On the right, if I userg --help
, this does work.Running this natively on the command line...
So I think that's proving that
rg rabbit
is writing to the stdout stream. But I can't see why it would fail when running the same command through CliWrap.Code from screenshot is here:
Ps. just want to also say thank you for the awesome project! I can't believe it's so difficult to do this kind of stuff in .NET natively! Very grateful of you spending the time to make this easier! 🙏🏼
The text was updated successfully, but these errors were encountered: