-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fail on non-zero exit status #18
Comments
I did not miss it, there is a nightly feature that converts does this non-zero status error by introducing a https://doc.rust-lang.org/std/process/struct.ExitStatus.html#method.exit_ok I don't think this program will want to use a nightly feature, but maybe? |
I wrote this issue before recognizing that many commands that exit with a non-zero code still have outputs that are nice to have within documentation pages. Maybe this becomes a configuration option or a different "flag" a user could provide to e.g.
Would require the exit code of |
Another option I like would be similar to the bats run syntax. Ignore the command's exit status (current behavior)
Require the command to exit with status
For example
|
Hi @tomeichlersmith ! I think this is a great feature that could be useful and used. For flags, something like:
would be nice, having both short and long arguments for this is a nice and easy bonus For the error message, feel free to invent one, there is nothing "standardized" in mdbook (to my knowledge) Feel free to work on this, I'll review the PR :) |
I'd like to add an extra check after the command has been run to ensure that it exited with a non-zero status.
(Context: it took me a long time to figure out I was just mis-spelling an option to the command I was running.)
The check would be put into
mdbook-cmdrun/src/cmdrun.rs
Lines 162 to 168 in d1fef67
and it could look something like
And
NonZeroStatus
would just be an error type a la https://doc.rust-lang.org/rust-by-example/error/multiple_error_types/define_error_type.html(Sidenote, this seems like a common thing maybe this is already implemented somewhere and I missed it?)
The text was updated successfully, but these errors were encountered: