rust_cmd_lib icon indicating copy to clipboard operation
rust_cmd_lib copied to clipboard

Behavior of semi-colon in macros is confusing

Open michaeleisel opened this issue 2 years ago • 1 comments

In a shell script, a semi-colon indicates that the next command should run regardless of if the preceding command succeeds. However, in run_cmd!, a semi-colon behaves like && instead. Ideally, both && and ; would be supported and behave like they do in a shell command, or if that's not possible, the README would make it extra clear how it differs.

michaeleisel avatar Feb 05 '24 13:02 michaeleisel

You can consider this library is doing set -euo pipefail for your script to try to catch all the errors, without introducing other pitfalls. Yeah, I can try to update the README a little bit more.

tao-guo avatar Feb 05 '24 15:02 tao-guo