Fix issue 2421 - Update config file output (#2443)

* Update config file output

* add more information in config error
This commit is contained in:
Kangaxx-0 2023-05-15 07:56:03 -07:00 committed by GitHub
parent 30d0cffa42
commit a2450b0d91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -444,11 +444,20 @@ impl Setup {
}
}
if let Some(config_file) = config_file {
writeln!(&mut message, "[CONFIG FILE]: {:?}", config_file).unwrap();
// match Config::new(&config_file) {
writeln!(
&mut message,
"[LOOKING FOR CONFIG FILE FROM]: {:?}",
config_file
)
.unwrap();
match Config::from_path(&config_file, None) {
Ok(_) => message.push_str("[CONFIG FILE]: Well defined.\n"),
Err(e) => writeln!(&mut message, "[CONFIG ERROR]: {}", e).unwrap(),
Err(e) => writeln!(
&mut message,
"[CONFIG ERROR]: {}. \n By default, zellij loads default configuration",
e
)
.unwrap(),
}
} else {
message.push_str("[CONFIG FILE]: Not Found\n");