tynanbe / shellout

🐢 A Gleam library for cross-platform shell operations
Apache License 2.0
46 stars 1 forks source link

Consider not regarding a non-zero exit code as a failure of `command` #7

Open lpil opened 6 months ago

lpil commented 6 months ago

Hello!

This library currently considers a process successfully being run and then returning a non-zero exit code as a failure of the command function. I think this is mixing up two different things, the running of a command, and what the output of that command was, and other than in simple cases makes it harder to use library as one cannot easily distinguish between the errors at the different level.

I would have the command function only return an error if it failed to run the command.

This would mirror the HTTP libraries where sending a HTTP request and getting back a 400 or a 500 is still a successful HTTP request.

Thanks, Louis

tynanbe commented 6 months ago

Sounds reasonable. Thanks.