Function run_script::spawn

source ·
pub fn spawn(
    script: &str,
    args: &Vec<String>,
    options: &ScriptOptions
) -> ScriptResult<Child>
Expand description

Invokes the provided script content and returns a process handle.

Arguments

  • script - The script content
  • args - The script command line arguments
  • options - Options provided to the script runner

Example

use run_script::ScriptOptions;

fn main() {
    let options = ScriptOptions::new();

    let args = vec![];

    let child = run_script::spawn(
        r#"
        echo "Directory Info:"
        dir
        "#,
        &args,
        &options
    ).unwrap();
}