Closed gdetal closed 4 years ago
This commit adds the option CMD_LIB_PIPE_FAIL. If set to 1 this will cause both run_cmd!() and run_fun!() to return an error when at least one command fails. This actually implements a similar behavior as -o pipefail from bash.
CMD_LIB_PIPE_FAIL
1
run_cmd!()
run_fun!()
-o pipefail
Example:
run_cmd!(cat` /non-existant | wc -l)?; // returns Ok(())
proc_env_set!(CMD_LIB_PIPE_FAIL = 1); run_cmd!(cat /non-existant | wc -l)?; // Returns Err(_)
This commit adds the option
CMD_LIB_PIPE_FAIL
. If set to1
this will cause bothrun_cmd!()
andrun_fun!()
to return an error when at least one command fails. This actually implements a similar behavior as-o pipefail
from bash.Example: