-
Notifications
You must be signed in to change notification settings - Fork 28
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
Some question about ignore directory #33
Comments
This is an older question but wanted to answer in case it can help others. TL;DRThis can already be accomplished with the existing functionality. Just use a more specific RegEx In your case you should use:
Long Answer/ExplanationThe key is understanding that the string being matched for the directory itself (e.g.,
If you're curious, you can debug the exclusion logic by watching this section of the code: Lines 71 to 76 in 42797f0
You'll want to place a break-point or console log something like this: console.log(\`Regex: ${options.exclude[i]}, Path: ${path}, Matched: ${options.exclude[i].test(path)}\`); Make sure to test with a simple example to avoid sifting through console logs or breakpoints until the end of time. Hope this helps and happy coding. Cheers! |
@slorber, This might be considered a non-issue and could be closed. However, it might be helpful to update the README with a concise explanation of this matching behavior for clarity. |
Hey @jtroussard , my time is a bit limited to maintain this package. I only became maintainer of it because I needed it for Docusaurus 😅 I never even used it as a CLI. If you feel that we can explain something better in the README, please send a docs PR directly |
Hello, is there have any parameter for distinction keep
node_modules
or hide it.When i run
tree -I "node_modules"
i got a result as below:The result i want(i want to keep itself when i add a ignore directory):
The text was updated successfully, but these errors were encountered: