-
-
Notifications
You must be signed in to change notification settings - Fork 477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to specify a maximum depth? #296
Comments
need this |
For two, the easiest way would be to use a pattern like this: Currently, there's no way to set a maximum depth for patterns like |
Returns the depth of the current path in the directory tree. Fix: #3 Re: isaacs/node-glob#296
Now that PathScurry tracks the depth, I'm thinking it might be possible to do something like:
which would only go as deep as the depth of the current working directory, plus the number specified. Would it be worthwhile to set a minimum depth as well? For example, to prevent absolute patterns or anything starting with This definitely has a few edge cases, because we translate |
Also, would minDepth prevent the walk or just the match? 🤔 Like, in this case: Would that match all the files in And if it wouldn't match anything, what about this? I think it's probably simpler to just say it limits maximum depth only, and prevents both the walk and the match. So: glob('../**', { cwd: '/a/b/c', maxDepth:2 }) would find |
For example if i have;
Is there a way to specify a maximum depth that the tree will be traversed, such that executing glob against the above would only return the first two paths, being 2 deep?
The text was updated successfully, but these errors were encountered: