115 karma · joined September 27, 2019
Maybe it is time to consider using rust instead: https://github.com/rust-shell-script/rust_cmd_lib ?
[1] https://github.com/anordal/shellharden/blob/master/how_to_do...
The “xxx || true” is for ignoring error within a group of commands, which is also very common in sh “set -e” mode. Without it, the group of commands need to be divided into at least 3 parts to still capture all possible command errors. I probably need to document this part with more details.
As you can see, it is very verbose and that's why I choose to hide the lower APIs at this moment.
However this can be fragile in bash script since any sub shell command can fail. I am still wandering how to support it in this rust_cmd_lib library.
This plumbum has its own “cp”, “cat” .., which is similar to shelljs and it looks like a lot of people like this idea which can also be supported by this library in the future.