Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix: prepare the first export directory before streaming audio

Jason Cameron9045f979af00
diff --git a/crates/export/src/lib.rs b/crates/export/src/lib.rs
index 86b5514ed..e90e2ec94 100644
--- a/crates/export/src/lib.rs
+++ b/crates/export/src/lib.rs
@@ -167,6 +167,12 @@ impl ExporterBuilder {
let output_path = self
.output_path
.unwrap_or_else(|| recording_meta.output_path());
+
+ if let Some(parent) = output_path.parent() {
+ std::fs::create_dir_all(parent)
+ .map_err(|e| ExporterBuildError::IO(parent.to_path_buf(), e))?;
+ }
+
let streaming_output = prepare_streaming_output(
&output_path,
cancellation.is_some() && ExportAudioRenderer::eligible(&project_config, studio_meta),
@@ -235,11 +241,6 @@ impl ExporterBuilder {
}
}
- if let Some(parent) = output_path.parent() {
- std::fs::create_dir_all(parent)
- .map_err(|e| ExporterBuildError::IO(parent.to_path_buf(), e))?;
- }
-
Ok(ExporterBase {
output_path,
studio_meta: studio_meta.clone(),