docs: recommend using `libexec.glob()` for symlinking binaries from npm modules by sushichan044 · Pull Request #21318 · Homebrew/brew
Reflect the pattern commonly used in newer npm module formulae
- Have you followed the guidelines in our Contributing document?
- Have you checked to ensure there aren't other open Pull Requests for the same change?
- Have you added an explanation of what your changes do and why you'd like us to include them?
- Have you written new tests for your changes? Here's an example.
- Have you successfully run
brew lgtm(style, typechecking and tests) with your changes locally?
Copilot AI review requested due to automatic review settings
December 24, 2025 11:52Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR updates the documentation to recommend using the libexec.glob() method instead of Dir[] for symlinking binaries from npm modules, aligning with patterns used in newer npm module formulae.
- Changes the recommended approach for symlinking npm module executables from
Dir["#{libexec}/bin/*"]tolibexec.glob("bin/*")
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
While inspecting several npm module formulae, I noticed cases where Dir["#{libexec}/bin/*"] was replaced with libexec.glob("bin/*")
Since calling .glob() appears to be the recommended approach now, I will update the documentation to recommend using .glob().
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
If we're going this route, we should also update formula_creator:
| <% elsif @mode == :node %> | |
| system "npm", "install", *std_npm_args | |
| bin.install_symlink Dir["\#{libexec}/bin/*"] |
@p-linnane
Thank you for the review. I missed this because I was only doing a simple search.
It has been fixed in e71dfda.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters