Skip to content

Commit

Permalink
✨ Make selector case-insensitive (mp4 & MP4 matches etc.)
Browse files Browse the repository at this point in the history
Close #47
  • Loading branch information
tgotwig committed Jul 18, 2024
1 parent 4fa1b25 commit c700806
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- **--verbose** which prints detailed logs.

### Changed

- Selector now case-insensitive, so it selects mp4 and MP4 etc.

## 🎉 [0.3.2] - 2024-01-14

### Added
Expand Down
5 changes: 3 additions & 2 deletions src/helpers/vec_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ use regex::Regex;
/// Returns a vector of PathBufs that match the given file format.
/// Also filters out files that start with a dot.
pub fn filter_files(all_files: Vec<PathBuf>, file_format: &str) -> Vec<PathBuf> {
let re = Regex::new(format!(r"[\\/][^.\\/][^\\/]*\.{}$", regex::escape(file_format)).as_str())
.unwrap();
let re: Regex =
Regex::new(format!(r"(?i)[\\/][^.\\/][^\\/]*\.{}$", regex::escape(file_format)).as_str())
.unwrap();
let mut filtered_files = Vec::new();

for possible_file_to_merge in all_files {
Expand Down

0 comments on commit c700806

Please sign in to comment.