verify if config file exists

This commit is contained in:
Iru Sensei 2023-07-23 16:21:39 +02:00
parent d982f84e39
commit 74edf9c26b

View File

@ -25,8 +25,9 @@ fn main() {
// get config file name from args
let config_file_arg = args.config;
// Quits if config file path does not exist
let config_file_path: &OsStr = OsStr::new(config_file_arg);
let config_file_path = config_file_arg.as_ref().map(|x| &**x).unwrap()
if !Path::new(&config_file_path).exists() {
eprintln!("Config file not found: {}", &config_file_path);
process::exit(1);