Hacker Newsnew | past | comments | ask | show | jobs | submit | more rustshellscript's commentslogin

It can be supported with internal APIs, even without macros: Cmds::from_cmd(Cmd(...).current_dir(..)) .pipe(Cmd(...).current_dir(...)) .run_cmd(...)

As you can see, it is very verbose and that's why I choose to hide the lower APIs at this moment.


I like your approach more than duct.rs :)


Thanks, yes since I just finished the core functionality of this project and I am not surprised if it is still missing some critical features when converting bash script. Pls file bugs if you find anything :)


You can consider it was enabled by default, and any failed command would return error unless you mask it with “xx || true”.


Yes, I also use this for automatically capturing command error messages with timestamps into logs: https://github.com/rust-shell-script/bash_cmd_lib/blob/0b0a6...

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.


Author here, thanks for your feedback. This library is calling std::process::command underneath without any shell dependency, which I believe is the same as plumbum’s run* APIs and I should make it clearer in the docs.

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.


I am recently working on a hobby programming language: https://github.com/rust-shell-script/rust-shell-script, which could compile to either rust code or shell script. This book helps me clarified a lot of things along the implementation.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: