main: when loading morphism base, remove . from path suffix variable

This commit is contained in:
Michael Sippel 2025-05-14 10:19:48 +02:00
parent ea2504ff07
commit 692a34c257
Signed by: senvas
GPG key ID: F96CF119C34B64A6

View file

@ -37,7 +37,7 @@ fn main() {
// 1.1. pfade ermitteln
let env_var = "MORPHISM_BASE";
let suffix = ".morphism-base";
let suffix = "morphism-base";
match std::env::var(env_var) {
Ok(path_str) => {
@ -46,7 +46,10 @@ fn main() {
for entry in WalkDir::new(path)
.into_iter()
.filter_map(Result::ok)
.filter(|e| e.path().is_file() && e.path().extension().map_or(false, |ext| ext == &suffix[1..]))
.filter(|e|
e.path().is_file() &&
e.path().extension().map_or(false, |ext| ext == suffix)
)
{
mb_paths.push(entry.path().into());
}