Print remove_dir_all error on ctrl-c

This commit is contained in:
Vincent Prouillet 2019-12-23 09:43:08 +01:00
parent 2f1b592ab4
commit adee654f30

View file

@ -278,7 +278,10 @@ pub fn serve(
println!("Press Ctrl+C to stop\n"); println!("Press Ctrl+C to stop\n");
// Delete the output folder on ctrl+C // Delete the output folder on ctrl+C
ctrlc::set_handler(move || { ctrlc::set_handler(move || {
let _ = remove_dir_all(&output_path); match remove_dir_all(&output_path) {
Ok(()) => (),
Err(e) => println!("Errored while deleting output folder: {}", e),
}
::std::process::exit(0); ::std::process::exit(0);
}) })
.expect("Error setting Ctrl-C handler"); .expect("Error setting Ctrl-C handler");