Skip to content
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

formula: add std_npm_args #17774

Merged
merged 1 commit into from
Jul 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Library/Homebrew/formula.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1847,6 +1847,16 @@
["--prefix=#{prefix}", "--libdir=#{lib}", "--buildtype=release", "--wrap-mode=nofallback"]
end

# Standard parameters for npm builds.
sig { params(prefix: T.any(String, Pathname, FalseClass)).returns(T::Array[String]) }
def std_npm_args(prefix: libexec)
require "language/node"

Check warning on line 1853 in Library/Homebrew/formula.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/formula.rb#L1853

Added line #L1853 was not covered by tests

return Language::Node.std_npm_install_args(Pathname(prefix)) if prefix

Language::Node.local_npm_install_args

Check warning on line 1857 in Library/Homebrew/formula.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/formula.rb#L1857

Added line #L1857 was not covered by tests
end

# Standard parameters for pip builds.
sig {
params(prefix: T.any(String, Pathname, FalseClass),
Expand Down Expand Up @@ -2964,6 +2974,8 @@
pretty_args -= std_go_args
when "meson"
pretty_args -= std_meson_args
when "npm"
pretty_args -= std_npm_args
when %r{(^|/)(pip|python)(?:[23](?:\.\d{1,2})?)?$}
pretty_args -= std_pip_args
end
Expand Down