Skip to content

Commit

Permalink
refactor(utils/fs): hoist ignore conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
egasimus authored and Bergmann89 committed Dec 19, 2024
1 parent a3dfab9 commit b459b9f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/utils/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit b459b9f

Please sign in to comment.