-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
fix: don't die if manNumberRegex doesn't match the glob (#4610) #4611
Conversation
This would need tests as well. |
I've added tests and significantly redid the PR. I also addressed an issue that I see as linked, but I can separate it out if you want - that frequently, |
Amusingly, there's actually no check that |
In certain edge cases, the glob could find files that manNumberRegex wouldn't match. A possible solution would be to try to bring the two closer, but since globs and regexes are different syntaxes, the two will never be exactly the same. It's always asking for bugs; better to just handle the issue directly. In addition, when npm is installed globally in a system directory, the glob can find other manpages with similar names. For instance "install.1", "init.1", etc. Preferring low-numbered sections isn't enough in these cases; it's also necessary to prefer the pages prefixed with "npm-".
Is there anything remaining here that I need to do? |
In certain edge cases, the glob could find files that manNumberRegex wouldn't match.
A possible solution would be to try to bring the two closer, but since globs and regexes are different syntaxes, the two will never be exactly the same.
It's always asking for bugs; better to just handle the issue directly.
In addition, when npm is installed globally in a system directory, the
glob can find other manpages with similar names.
For instance "install.1", "init.1", etc. Preferring low-numbered
sections isn't enough in these cases; it's also necessary to prefer
the pages prefixed with "npm-".
Fixes #4610