mirror of
https://github.com/Sarsoo/csbindgen.git
synced 2024-12-23 06:56:27 +00:00
make sure the parent directory exists
This commit is contained in:
parent
743abbed28
commit
b23e1864c4
@ -232,6 +232,10 @@ impl Builder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn make_file<P: AsRef<Path>>(path: P) -> io::Result<File> {
|
fn make_file<P: AsRef<Path>>(path: P) -> io::Result<File> {
|
||||||
|
let path = path.as_ref();
|
||||||
|
if let Some(parent) = path.parent() {
|
||||||
|
std::fs::create_dir_all(parent)?;
|
||||||
|
}
|
||||||
let file = OpenOptions::new()
|
let file = OpenOptions::new()
|
||||||
.write(true)
|
.write(true)
|
||||||
.truncate(true)
|
.truncate(true)
|
||||||
|
Loading…
Reference in New Issue
Block a user