use bare_script::sync::CommandBuilder;
use thiserror as _;
use tokio as _;
fn main() -> Result<(), bare_script::ScriptError> {
#[cfg(windows)]
let output = {
CommandBuilder::new("cmd")
.args(["/C", "echo Hello from bare-script!"])
.capture_output()
.execute()
};
#[cfg(not(windows))]
let output = {
CommandBuilder::new("echo")
.arg("Hello from bare-script!")
.capture_output()
.execute()
};
let output = output?;
println!("Exit code: {:?}", output.code());
println!("Stdout: {}", output.stdout_str());
println!("Success: {}", output.success());
Ok(())
}