Skip to content

Commit

Permalink
Fix issue 2421 - Update config file output (#2443)
Browse files Browse the repository at this point in the history
* Update config file output

* add more information in config error
  • Loading branch information
Kangaxx-0 authored May 15, 2023
1 parent 30d0cff commit a2450b0
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions zellij-utils/src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit a2450b0

Please sign in to comment.