mirror of
https://github.com/Sarsoo/csbindgen.git
synced 2024-12-22 22:46:26 +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> {
|
||||
let path = path.as_ref();
|
||||
if let Some(parent) = path.parent() {
|
||||
std::fs::create_dir_all(parent)?;
|
||||
}
|
||||
let file = OpenOptions::new()
|
||||
.write(true)
|
||||
.truncate(true)
|
||||
|
Loading…
Reference in New Issue
Block a user