rainbow-dash

Crates.iorainbow-dash
lib.rsrainbow-dash
version0.1.1
sourcesrc
created_at2024-04-15 00:11:57.912209
updated_at2024-05-15 05:02:44.851321
descriptionCommand execution library for Linux/macOS and Windows.
homepage
repositoryhttps://github.com/SilkRose/Rarity
max_upload_size
id1208680
size5,735
(SilkRose)

documentation

README

Rainbow Dash

Command execution library for Linux/macOS and Windows.

Has functions with status and output variants.

Example usage:

Running a command that is the same on Linux/macOS and Windows:

let status = execute_command("echo 'Pinkie Pie is best pony!'")?;
println!("{}", status.success()); // true or false

Running a command with output that is the same on Linux/macOS and Windows:

let output = execute_command_with_return("echo 'Pinkie Pie is best pony!'")?;
println!("{}", String::from_utf8(output.stdout)?); // Pinkie Pie is best pony!

If your commands are different on Linux/macOS and Windows, you can use the target-specific functions:

#[cfg(not(target_os = "windows"))]
let status = execute_unix_command("ls -la");
#[cfg(target_os = "windows")]
let status = execute_windows_command("dir /a /w");
println!("{}", status.success()); // true or false
Commit count: 16

cargo fmt