Skip to content
Snippets Groups Projects
Commit c5063c59 authored by rarbore2's avatar rarbore2
Browse files

panic if xdot can't be run

parent 8159c6c1
No related branches found
No related tags found
1 merge request!198Optimization for miranda
Pipeline #201831 passed
This commit is part of merge request !198. Comments created here will be created in the context of that merge request.
...@@ -44,10 +44,17 @@ pub fn xdot_module( ...@@ -44,10 +44,17 @@ pub fn xdot_module(
file.write_all(contents.as_bytes()) file.write_all(contents.as_bytes())
.expect("PANIC: Unable to write output file contents."); .expect("PANIC: Unable to write output file contents.");
println!("Graphviz written to: {}", tmp_path.display()); println!("Graphviz written to: {}", tmp_path.display());
Command::new("xdot") let mut xdot_process = Command::new("xdot")
.args([&tmp_path]) .args([&tmp_path])
.output() .spawn()
.expect("PANIC: Couldn't execute xdot. Is xdot installed?"); .expect("PANIC: Couldn't execute xdot. Is xdot installed?");
assert!(
xdot_process
.wait()
.map(|status| status.success())
.unwrap_or(false),
"PANIC: Xdot failed to execute."
)
} }
/* /*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment