From bd58da1c17ea22e250c2a80574c446a5399c97d3 Mon Sep 17 00:00:00 2001 From: licsber Date: Sun, 8 Sep 2024 10:54:59 +0800 Subject: [PATCH] fix only process one file. --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 858ee17..68b9c05 100644 --- a/src/main.rs +++ b/src/main.rs @@ -41,7 +41,7 @@ fn process_compressed_files(path: &Path) -> io::Result<()> { process_compressed_files(&entry_path)?; } else if let Some(ext) = entry_path.extension().and_then(|e| e.to_str()) { if ext == "rar" || ext == "zip" { - return unar_file(&entry_path); + unar_file(&entry_path).expect("UNAR Error."); } } } @@ -58,6 +58,10 @@ fn main() -> io::Result<()> { PathBuf::from(".") }; + if start_path.is_file() { + return unar_file(&start_path); + } + process_compressed_files(&start_path)?; Ok(())