changed html report file output check before scanning
This commit is contained in:
12
src/main.rs
12
src/main.rs
@@ -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