Merge pull request #1330 from Vlad-Shcherbina/mkdir_pkg

Create --out_dir (usually "pkg") if it does not exist
This commit is contained in:
Alex Crichton 2019-03-07 12:08:37 -06:00 committed by GitHub
commit f00c74aeb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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()))?;