croshet
A cross-platform UNIX-like shell scripting library, developed by pesde primarily to solve the annoying rimraf problem.
Examples
Shorthand macro
Execute a singular command, or run them in bulk without much control over how:
println!;
Manual execution
Lower level API to manually run commands with full control over the options and lifecycle of the process:
// Parse the text
let list = parse?;
let kill_signal = default;
let options = new
.args // Args to be passed to the shell itself
.env_vars // Environment variables that are set globally
.cwd // The working directory of the shell process
.custom_commands // HashMap of custom commands to be defined
.kill_signal // Pass the kill signal to control termination fo the process
.stdin // The standard input pipe
.stdout // The standard output pipe
.stderr // The standard error pipe
.build?;
// Execute!
println!;
// ...Or, execute with a timeout
// Set up a separate task to cancel the execution in 5s
spawn;
let exit_code = execute.await;
println!;
What's with the name?
This project was initially forked from Deno's deno_task_shell, which we found a bit too boring of a name :p
Instead, we settled for the name croshet, pronounced /kroʊˈʃeɪ/ (or simply, 'crochet'), as the library "crochets together" several UNIX-y shell features (most POSIX sh and some bash features, common UNIX command line tools, etc.) with a bit of shell related flair.