Skip to content

Instantly share code, notes, and snippets.

@raine
Created December 8, 2022 18:45
Show Gist options
  • Save raine/213e8196185840c7936dd895406c4cbf to your computer and use it in GitHub Desktop.
Save raine/213e8196185840c7936dd895406c4cbf to your computer and use it in GitHub Desktop.
let mut command = Command::new("chromedriver");
command.kill_on_drop(true); // Useful for killing the process in case of a panic
command.stdout(Stdio::piped());
let mut child = command.spawn().expect("chromedriver failed to start");
// [...] read stdout etc.
child.start_kill()?;
child.wait().await?;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment