Skip to content

Apply includePatterns and excludePatterns when walking for files#116

Open
zetafunction wants to merge 3 commits intoautobrr:mainfrom
zetafunction:ignore-dirs
Open

Apply includePatterns and excludePatterns when walking for files#116
zetafunction wants to merge 3 commits intoautobrr:mainfrom
zetafunction:ignore-dirs

Conversation

@zetafunction
Copy link

This allows subdirectories to be excluded by name; mktorrent supports this. Useful to avoid including directories like ANY!, FAB!, or MAKEMKV in torrents.

I'm not sure if this is the best approach, since it does make it more annoying to use mkbrr if you use --include with torrents that include multiple subdirectories; after this, you'll need to include all intermediate subdirectories in the --include patterns as well.

I experimented with another approach to support matching on the path when a pattern contains path separators but it felt clunkier: in the MAKEMKV example, you might need to pass something like --exclude "MAKEMKV/*,MAKEMKV/*/*,MAKEMKV/*/*/*".

Another approach is to add --includeDirs and --excludeDirs and use those specifically for subdirectory checks to avoid changing the current meaning of --include and --exclude.

This allows subdirectories to be excluded by name.
@s0up4200
Copy link
Collaborator

Hey! Thanks for the PR 👍

Another approach is to add --includeDirs and --excludeDirs and use those specifically for subdirectory checks to avoid changing the current meaning of --include and --exclude.

This sounds like the most sensible option to me I think 🤔

But either way, the important part is to keep it simple, and easy for users to understand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants