Skip to content

Commit

Permalink
Merge pull request #17774 from branchvincent/std_npm_args
Browse files Browse the repository at this point in the history
formula: add `std_npm_args`
  • Loading branch information
Bo98 committed Jul 25, 2024
2 parents eda3039 + 959bf28 commit 5edcaf3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Library/Homebrew/formula.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1848,6 +1848,16 @@ def std_meson_args
["--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"

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

Language::Node.local_npm_install_args
end

# Standard parameters for pip builds.
sig {
params(prefix: T.any(String, Pathname, FalseClass),
Expand Down Expand Up @@ -2965,6 +2975,8 @@ def system(cmd, *args)
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

0 comments on commit 5edcaf3

Please sign in to comment.