changed html report file output check before scanning
This commit is contained in:
1 parent
d1851c6a42
commit
793f28d7fe
2 files changed
+12
-9
No files matched your search
+12
@@ -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,
|
||||
|
||||
@@ -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!(
|
||||
"{}",
|
||||
|
||||
Reference in new issue
Block a user