Browse Source

Print remove_dir_all error on ctrl-c

index-subcmd
Vincent Prouillet 4 years ago
parent
commit
adee654f30
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      src/cmd/serve.rs

+ 4
- 1
src/cmd/serve.rs 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");


Loading…
Cancel
Save