macro_rules! run_script {
($script:expr) => { ... };
($script:expr, $options:expr) => { ... };
}Expand description
Run OpenScript code with optional configuration.
This macro provides a convenient way to run OpenScript code with either default options or custom configuration.
ยงExamples
use openrunner_rs::{run_script, ScriptOptions};
use std::time::Duration;
// Run with default options. This assumes `openscript` is in the PATH.
// let result = run_script!("echo 'Hello from default openscript!'").await?;
// Run with custom options (shell for testing)
let options = ScriptOptions::new().openscript_path("/bin/sh");
let result = run_script!("echo 'Hello, World!'", options).await?;
// Run with additional configuration
let options = ScriptOptions::new()
.openscript_path("/bin/sh")
.timeout(Duration::from_secs(30));
let result = run_script!("echo 'Hello, World!'", options).await?;