diff --git a/src/config.rs b/src/config.rs index cfdcbbf..2920855 100644 --- a/src/config.rs +++ b/src/config.rs @@ -92,7 +92,8 @@ impl ZoneConfig { let path = confy::get_configuration_file_path(env!("CARGO_PKG_NAME"), "interfaces").expect("Something went wrong with confy"); let zones_dir = path.parent().expect("Something went wrong with confy").join("zones.d/"); - let zones = fs::read_dir(zones_dir).unwrap(); + let zones = fs::read_dir(zones_dir).expect("Directory creation handling does not yet exist"); + let mut zone_configs: Vec = vec![]; @@ -106,7 +107,9 @@ impl ZoneConfig { false => eprintln!("[WARN] {warn_msg}"), } } - else { + else if !path.file_name().expect("Directories should have been filtered out by the leading if") + .to_str().expect("Conversion to str should not fail for a file name") + .starts_with('.') { let zone_config_path = format!("zones.d/{}", path.file_stem() .expect("stem could not be extracted from filename").to_str() .expect("&OsStr could not be converted to &str"));