This commit is contained in:
JMARyA 2025-01-09 23:00:22 +01:00
parent 753f53d4da
commit 227b97b27f
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
6 changed files with 87 additions and 63 deletions

View file

@ -97,20 +97,20 @@ pub fn read_conf(config_file: &str) -> InstallConfig {
let config_content = std::fs::read_to_string(config_file);
match config_content {
Ok(content) => match toml::from_str(&content) {
Ok(config) => config,
Err(e) => {
eprintln!(
"{} {}",
"Error: Could not deserialize TOML file.".paint(Color::Red),
e.paint(Color::Red)
);
std::process::exit(1);
}
},
Err(_) => {
eprintln!("{}", "Error: Could not read config file.".paint(Color::Red));
std::process::exit(1);
}
Ok(content) => match toml::from_str(&content) {
Ok(config) => config,
Err(e) => {
eprintln!(
"{} {}",
"Error: Could not deserialize TOML file.".paint(Color::Red),
e.paint(Color::Red)
);
std::process::exit(1);
}
}
},
Err(_) => {
eprintln!("{}", "Error: Could not read config file.".paint(Color::Red));
std::process::exit(1);
}
}
}