mod file_handler;
use std::io::Result;
+use std::process::exit;
use std::env::current_dir;
use std::fs::{create_dir_all, remove_dir_all};
// Step 3. Load the layout
let mut file_handler = FileHandler::default();
- file_handler.get_layout_or_panic(&files);
+ match file_handler.get_layout_or_panic(&files) {
+ Ok(_) => {},
+ Err(error) => {
+ eprintln!("{}", error);
+ exit(1);
+ }
+ }
// Step 4. Process all files
file_handler.handle_all(&source, &destination, &files);