changed html report file output check before scanning

This commit is contained in:
DastInDark
2022-09-27 21:41:17 +09:00
parent d1851c6a42
commit 793f28d7fe
2 changed files with 12 additions and 9 deletions

View File

@@ -262,6 +262,18 @@ impl App {
println!();
}
if let Some(path) = &configs::CONFIG.read().unwrap().args.html_report {
// if already exists same html report file. output alert message and exit
if path.exists() {
AlertMessage::alert(&format!(
" The file {} already exists. Please specify a different filename.",
path.to_str().unwrap()
))
.ok();
return;
}
}
write_color_buffer(
&BufferWriter::stdout(ColorChoice::Always),
None,

View File

@@ -95,15 +95,6 @@ pub fn create_html_file(input_html: String, path_str: String) {
create_dir(path.parent().unwrap()).ok();
}
// if already exists same html report file. output alert message and exit
if path.exists() {
AlertMessage::alert(&format!(
" The file {} already exists. Please specify a different filename.",
&path_str
))
.ok();
return;
}
let mut html_writer = BufWriter::new(File::create(path).unwrap());
let html_data = format!(
"{}",