create parent directories
This commit is contained in:
parent
8736fa8638
commit
5abea8dec9
1 changed files with 3 additions and 0 deletions
|
@ -118,6 +118,9 @@ fn convert_file(path: &Path) -> Result {
|
||||||
let template = read_to_string(TEMPLATE_FILE)?;
|
let template = read_to_string(TEMPLATE_FILE)?;
|
||||||
let html = template.replacen(CONTENT_MARKER, &html, 1);
|
let html = template.replacen(CONTENT_MARKER, &html, 1);
|
||||||
|
|
||||||
|
DirBuilder::new()
|
||||||
|
.recursive(true)
|
||||||
|
.create(out_path.parent().unwrap())?;
|
||||||
let mut file = File::create(&out_path)?;
|
let mut file = File::create(&out_path)?;
|
||||||
file.write_all(html.as_bytes())?;
|
file.write_all(html.as_bytes())?;
|
||||||
println!("built {}", out_path.display());
|
println!("built {}", out_path.display());
|
||||||
|
|
Loading…
Reference in a new issue