From 7c72d848131dbfcef47663bc6dd3e7c87225b7e4 Mon Sep 17 00:00:00 2001 From: A Farzat Date: Sun, 8 Mar 2026 11:25:30 +0300 Subject: Use XDG directories to map downloads This provides standard locations for files regardless of the location of the binary and/or the working directory. Could allow some customization in the future, both as a permanent config or one-time case. --- src/epub.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/epub.rs') diff --git a/src/epub.rs b/src/epub.rs index 79ac11e..4f31784 100644 --- a/src/epub.rs +++ b/src/epub.rs @@ -74,6 +74,9 @@ pub fn create_epub_archive( file_entries: &[FileEntry], chapters: &HashMap, ) -> Result<()> { + if let Some(parent_dir) = output_epub.parent() { + std::fs::create_dir_all(parent_dir)?; + } let out_file = std::fs::File::create(output_epub)?; let mut zip = ZipWriter::new(out_file); -- cgit v1.2.3-70-g09d2