From 2d12d5e846cbb9a1d75a485bc5ab05b4a2da76ac Mon Sep 17 00:00:00 2001 From: fukusuket Date: Fri, 19 Aug 2022 02:25:19 +0900 Subject: [PATCH] fix: add file existing check when -f option specified. issue #664 --- src/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main.rs b/src/main.rs index b7fe4801..05a97cc2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -213,6 +213,14 @@ impl App { } self.analysis_files(live_analysis_list.unwrap(), &time_filter); } else if let Some(filepath) = &configs::CONFIG.read().unwrap().args.filepath { + if !filepath.exists() { + AlertMessage::alert(&format!( + " The file {} does not exist. Please specify a valid file path.", + filepath.as_os_str().to_str().unwrap() + )) + .ok(); + return; + } if !TARGET_EXTENSIONS.contains( filepath .extension()