Add detection of invalid configs

This commit is contained in:
Victor Fuentes 2022-09-12 18:09:47 -04:00
parent 19b78dddcf
commit 0248dd6809
No known key found for this signature in database
GPG Key ID: 0A88B68D6A9ACAE0

View File

@ -378,7 +378,19 @@ impl Component for AppModel {
let (config, welcome) = if let Some(config) = getconfig() {
debug!("Got config: {:?}", config);
(config, false)
if !Path::new(&config.systemconfig).exists() {
warn!("Invalid system config path: {}", config.systemconfig);
(config, true)
} else if let Some(flakepath) = &config.flake {
if !Path::new(&flakepath).exists() {
warn!("Invalid flake path: {}", flakepath);
(config, true)
} else {
(config, false)
}
} else {
(config, false)
}
} else {
// Show welcome page
debug!("No config found");