mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
dev-cmd/create: add --node option
This commit is contained in:
parent
df17f8a0cf
commit
a3f1e09bce
@ -29,6 +29,8 @@ module Homebrew
|
|||||||
description: "Create a basic template for a Go build."
|
description: "Create a basic template for a Go build."
|
||||||
switch "--meson",
|
switch "--meson",
|
||||||
description: "Create a basic template for a Meson-style build."
|
description: "Create a basic template for a Meson-style build."
|
||||||
|
switch "--node",
|
||||||
|
description: "Create a basic template for a Node build."
|
||||||
switch "--perl",
|
switch "--perl",
|
||||||
description: "Create a basic template for a Perl build."
|
description: "Create a basic template for a Perl build."
|
||||||
switch "--python",
|
switch "--python",
|
||||||
@ -54,7 +56,7 @@ module Homebrew
|
|||||||
switch :force
|
switch :force
|
||||||
switch :verbose
|
switch :verbose
|
||||||
switch :debug
|
switch :debug
|
||||||
conflicts "--autotools", "--cmake", "--crystal", "--go", "--meson", "--perl", "--python", "--rust"
|
conflicts "--autotools", "--cmake", "--crystal", "--go", "--meson", "--node", "--perl", "--python", "--rust"
|
||||||
named 1
|
named 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -92,6 +94,8 @@ module Homebrew
|
|||||||
:crystal
|
:crystal
|
||||||
elsif args.go?
|
elsif args.go?
|
||||||
:go
|
:go
|
||||||
|
elsif args.node?
|
||||||
|
:node
|
||||||
elsif args.perl?
|
elsif args.perl?
|
||||||
:perl
|
:perl
|
||||||
elsif args.python?
|
elsif args.python?
|
||||||
|
@ -84,6 +84,10 @@ module Homebrew
|
|||||||
# Documentation: https://docs.brew.sh/Formula-Cookbook
|
# Documentation: https://docs.brew.sh/Formula-Cookbook
|
||||||
# https://rubydoc.brew.sh/Formula
|
# https://rubydoc.brew.sh/Formula
|
||||||
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
|
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
|
||||||
|
<% if mode == :node %>
|
||||||
|
require "language/node"
|
||||||
|
|
||||||
|
<% end %>
|
||||||
class #{Formulary.class_s(name)} < Formula
|
class #{Formulary.class_s(name)} < Formula
|
||||||
<% if mode == :python %>
|
<% if mode == :python %>
|
||||||
include Language::Python::Virtualenv
|
include Language::Python::Virtualenv
|
||||||
@ -112,6 +116,8 @@ module Homebrew
|
|||||||
<% elsif mode == :meson %>
|
<% elsif mode == :meson %>
|
||||||
depends_on "meson" => :build
|
depends_on "meson" => :build
|
||||||
depends_on "ninja" => :build
|
depends_on "ninja" => :build
|
||||||
|
<% elsif mode == :node %>
|
||||||
|
depends_on "node"
|
||||||
<% elsif mode == :perl %>
|
<% elsif mode == :perl %>
|
||||||
uses_from_macos "perl"
|
uses_from_macos "perl"
|
||||||
<% elsif mode == :python %>
|
<% elsif mode == :python %>
|
||||||
@ -153,6 +159,9 @@ module Homebrew
|
|||||||
system "ninja", "-v"
|
system "ninja", "-v"
|
||||||
system "ninja", "install", "-v"
|
system "ninja", "install", "-v"
|
||||||
end
|
end
|
||||||
|
<% elsif mode == :node %>
|
||||||
|
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
|
||||||
|
bin.install_symlink Dir["\#{libexec}/bin/*"]
|
||||||
<% elsif mode == :perl %>
|
<% elsif mode == :perl %>
|
||||||
ENV.prepend_create_path "PERL5LIB", libexec/"lib/perl5"
|
ENV.prepend_create_path "PERL5LIB", libexec/"lib/perl5"
|
||||||
ENV.prepend_path "PERL5LIB", libexec/"lib"
|
ENV.prepend_path "PERL5LIB", libexec/"lib"
|
||||||
|
@ -169,6 +169,7 @@ _brew_create() {
|
|||||||
--help
|
--help
|
||||||
--meson
|
--meson
|
||||||
--no-fetch
|
--no-fetch
|
||||||
|
--node
|
||||||
--perl
|
--perl
|
||||||
--python
|
--python
|
||||||
--ruby
|
--ruby
|
||||||
|
@ -784,6 +784,8 @@ a simple example. For the complete API, see:
|
|||||||
Create a basic template for a Go build.
|
Create a basic template for a Go build.
|
||||||
* `--meson`:
|
* `--meson`:
|
||||||
Create a basic template for a Meson-style build.
|
Create a basic template for a Meson-style build.
|
||||||
|
* `--node`:
|
||||||
|
Create a basic template for a Node build.
|
||||||
* `--perl`:
|
* `--perl`:
|
||||||
Create a basic template for a Perl build.
|
Create a basic template for a Perl build.
|
||||||
* `--python`:
|
* `--python`:
|
||||||
|
@ -1022,6 +1022,10 @@ Create a basic template for a Go build\.
|
|||||||
Create a basic template for a Meson\-style build\.
|
Create a basic template for a Meson\-style build\.
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
|
\fB\-\-node\fR
|
||||||
|
Create a basic template for a Node build\.
|
||||||
|
.
|
||||||
|
.TP
|
||||||
\fB\-\-perl\fR
|
\fB\-\-perl\fR
|
||||||
Create a basic template for a Perl build\.
|
Create a basic template for a Perl build\.
|
||||||
.
|
.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user