From b459b9f82e2d392253c827524dea363785339c02 Mon Sep 17 00:00:00 2001 From: Adam Avramov Date: Sun, 3 Sep 2023 09:07:37 +0300 Subject: [PATCH] refactor(utils/fs): hoist ignore conditional --- src/utils/fs.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/utils/fs.rs b/src/utils/fs.rs index 9bf46ed83e..33cccac85d 100644 --- a/src/utils/fs.rs +++ b/src/utils/fs.rs @@ -115,6 +115,14 @@ pub fn copy_files_except_ext( let entry_file_name = entry.file_name().unwrap(); let target_file_path = to.join(entry_file_name); + // Check if it is in the blacklist + if let Some(ignore) = ignore { + let path = entry.as_path(); + if ignore.matched(&path, path.is_dir()).is_ignore() { + continue; + } + } + // If the entry is a dir and the recursive option is enabled, call itself if metadata.is_dir() && recursive { if entry == to.as_os_str() {