Ensure output dir for dataflow results exists

This commit is contained in:
Dylan MacKenzie 2020-03-28 14:09:34 -07:00
parent c8004027ba
commit 4d1194c31a

View file

@ -444,7 +444,12 @@ where
let graphviz = graphviz::Formatter::new(body, def_id, results, &mut *formatter);
dot::render_opts(&graphviz, &mut buf, &[dot::RenderOption::Monospace])?;
if let Some(parent) = path.parent() {
fs::create_dir_all(parent)?;
}
fs::write(&path, buf)?;
Ok(())
}