Closed tulth closed 1 year ago
I think you nailed it: it's about the preProcess
case. I don't mind including a version of shell
like you've described, but we need to include a caveat about how it may work differently from proc
in the docs. Generally, my recommendation is to avoid shell
whenever possible.
Do you think I should try my hand at a PR for this - or is this something that does not belong in RIO?
If someone actually has a use case for it I'm not opposed. But I've never really heard of a good use case for shell
over proc
.
Just curious, from System.Process.Typed, RIO has
proc
wrapped nicely, but notshell
. Does something prevent addingshell
? Perhaps it is because it is hard to cover exceptional behavior likepreProcess
covers?RIO shell could be something like this:
At least, for withProcessTimeLog, it logs the full command anyway, so it seems it could be rewritten, and have the existing string packer stuff done in another function or on demand if only done once: https://github.com/commercialhaskell/rio/blob/23e7c18bbbb54c9f83d64a5a2878f833eef45746/rio/src/RIO/Process.hs#L401-L405
Apologies if this is a dumb question; I am not a haskell expert.