From b784d5e1794a3c2e6901f334d705e337b233a825 Mon Sep 17 00:00:00 2001 From: Jorik Cronenberg Date: Tue, 24 Sep 2024 16:00:31 +0200 Subject: [PATCH] Skip files not ending in .xml in directories --- rust/migrate-wicked/src/reader.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rust/migrate-wicked/src/reader.rs b/rust/migrate-wicked/src/reader.rs index dcc75c9253..ffc6692166 100644 --- a/rust/migrate-wicked/src/reader.rs +++ b/rust/migrate-wicked/src/reader.rs @@ -101,6 +101,14 @@ pub fn read(paths: Vec) -> Result { if path.is_dir() { let files = recurse_files(path)?; for file in files { + match file.extension() { + None => continue, + Some(ext) => { + if !ext.eq("xml") { + continue; + } + } + } let mut read_xml = read_xml_file(file)?; if result.warning.is_none() && read_xml.warning.is_some() { result.warning = read_xml.warning