Automatically create parent dirs for recording path

Fixes #679
This commit is contained in:
Marcin Kulik
2025-06-01 09:32:40 +02:00
parent 8e5893e820
commit f29f112f0c

View File

@@ -223,6 +223,10 @@ impl cli::Session {
append = false;
}
if let Some(dir) = path.parent() {
let _ = fs::create_dir_all(dir);
}
let format = self.output_format.map(Ok).unwrap_or_else(|| {
if path.extension().is_some_and(|ext| ext == "txt") {
Ok(Format::Txt)