mirror of
https://github.com/snowfallorg/nix-software-center.git
synced 2024-08-18 01:20:21 +03:00
Add detection of invalid configs
This commit is contained in:
parent
19b78dddcf
commit
0248dd6809
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user