Create out_dir (usually "pkg") if it does not exist

This commit is contained in:
Vlad Shcherbina 2019-03-07 19:56:57 +03:00
parent eaaf3461bd
commit 2a2581188a

View File

@ -350,6 +350,7 @@ impl Bindgen {
} else {
"js"
};
fs::create_dir_all(out_dir)?;
let js_path = out_dir.join(stem).with_extension(extension);
fs::write(&js_path, reset_indentation(&js))
.with_context(|_| format!("failed to write `{}`", js_path.display()))?;