Is there a good way to handle cases where the child executes a command that doesn't exit as expected?
#Using process Command spawn
6 messages · Page 1 of 1 (latest)
If you're using .status(), check the ExitStatus (https://doc.rust-lang.org/std/process/struct.ExitStatus.html) that it returns.
If using .output(), the Output struct has a Status field with the exit status.
If using .spawn(), the Child struct it returns has wait and try_wait, which both return the exit status
But what I’m wondering is if the command executed in the child process doesn’t indicate it’s exited with this error (or in the user’s environment).
one way would be parsing the output of python --version I guess, but a success return code in the case where python isn't installed is very weird
A setup where python is a valid command and not python sounds really weird
I think fleshing out huak::env::system will help catch a lot of this, so the usually robustness work, but yea figuring out how to handle a sub process that doesn’t exit is definitely on my agenda.