Crates.io | build-pretty |
lib.rs | build-pretty |
version | 1.0.0 |
source | src |
created_at | 2022-05-04 04:34:31.039906 |
updated_at | 2022-05-04 04:34:31.039906 |
description | Pretty to your custom Build Script(build.sh) log displaying! |
homepage | |
repository | https://github.com/usagi/build-pretty |
max_upload_size | |
id | 580190 |
size | 23,072 |
This lib crate is one of workarround solution for log displaying of Build Scripts issue such as rust-lang/cargo#985.
build-pretty
dependency in [build-dependencies]
of your project's Cargo.toml
[package]
...
build = "build.rs"
...
[build-dependencies]
build-pretty = "*"
build.rs
with build-pretty
:use build_pretty::{
build_pretty,
CommandBuilder
};
fn main()
{
build_pretty!()
.enque_command("Drink a cup of tea", CommandBuilder::new_with_arg("echo", "🍵 Green!\n☕ Black!\n🧋 Bubbles!").into())
.enque_command("Eat a hotdog", CommandBuilder::new_with_arg("echo", "🌭 Hotdog!\n♨️ Hot?\n🐕 Dog!\n🌶️ Hot?\n🐶 Dog?").into())
.enque_command("ls -l -a", CommandBuilder::new_with_args("ls", &["-l", "-a"]).into())
.enque_fn("Ofcourse Fn can be used", Box::new(|output|{ *output = "brabrabra\nmewmewmew\nnekonyankonyanko🐾".to_string(); Ok(()) }))
.enque_command("Sleep", CommandBuilder::new_with_arg("echo", "😴 I'm sleee....\n💤...\n🛌....pyyyyy....").into());
}
and then:
std::process::Command
runner with STDOUT/STRERR log capturing!Fn
runner with String
output capturing!cargo_warning_ln!
macro, it's also to Build Script version println!
.