Skip to content

Commit

Permalink
Merge pull request #9 from giovannimirarchi420/fix/include-filters
Browse files Browse the repository at this point in the history
Improved handling of multiple patterns in include_filters (dircpy issue #8)
  • Loading branch information
woelper authored Jul 22, 2024
2 parents 5d11e6b + e309613 commit 219269a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,12 @@ impl CopyBuilder {
}
}

for f in &self.include_filters {
if !entry.path().to_string_lossy().contains(f) {
continue 'files;
}
if !self
.include_filters
.iter()
.any(|f| entry.path().to_string_lossy().contains(f))
{
continue 'files;
}

// File is not present: copy it in any case
Expand Down

0 comments on commit 219269a

Please sign in to comment.