Skip to content
Snippets Groups Projects
Commit a3f1e09b authored by Seeker's avatar Seeker
Browse files

dev-cmd/create: add --node option

parent df17f8a0
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,8 @@ module Homebrew
description: "Create a basic template for a Go build."
switch "--meson",
description: "Create a basic template for a Meson-style build."
switch "--node",
description: "Create a basic template for a Node build."
switch "--perl",
description: "Create a basic template for a Perl build."
switch "--python",
......@@ -54,7 +56,7 @@ module Homebrew
switch :force
switch :verbose
switch :debug
conflicts "--autotools", "--cmake", "--crystal", "--go", "--meson", "--perl", "--python", "--rust"
conflicts "--autotools", "--cmake", "--crystal", "--go", "--meson", "--node", "--perl", "--python", "--rust"
named 1
end
end
......@@ -92,6 +94,8 @@ module Homebrew
:crystal
elsif args.go?
:go
elsif args.node?
:node
elsif args.perl?
:perl
elsif args.python?
......
......@@ -84,6 +84,10 @@ module Homebrew
# Documentation: https://docs.brew.sh/Formula-Cookbook
# https://rubydoc.brew.sh/Formula
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
<% if mode == :node %>
require "language/node"
<% end %>
class #{Formulary.class_s(name)} < Formula
<% if mode == :python %>
include Language::Python::Virtualenv
......@@ -112,6 +116,8 @@ module Homebrew
<% elsif mode == :meson %>
depends_on "meson" => :build
depends_on "ninja" => :build
<% elsif mode == :node %>
depends_on "node"
<% elsif mode == :perl %>
uses_from_macos "perl"
<% elsif mode == :python %>
......@@ -153,6 +159,9 @@ module Homebrew
system "ninja", "-v"
system "ninja", "install", "-v"
end
<% elsif mode == :node %>
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["\#{libexec}/bin/*"]
<% elsif mode == :perl %>
ENV.prepend_create_path "PERL5LIB", libexec/"lib/perl5"
ENV.prepend_path "PERL5LIB", libexec/"lib"
......
......@@ -169,6 +169,7 @@ _brew_create() {
--help
--meson
--no-fetch
--node
--perl
--python
--ruby
......
......@@ -784,6 +784,8 @@ a simple example. For the complete API, see:
Create a basic template for a Go build.
* `--meson`:
Create a basic template for a Meson-style build.
* `--node`:
Create a basic template for a Node build.
* `--perl`:
Create a basic template for a Perl build.
* `--python`:
......
......@@ -1022,6 +1022,10 @@ Create a basic template for a Go build\.
Create a basic template for a Meson\-style build\.
.
.TP
\fB\-\-node\fR
Create a basic template for a Node build\.
.
.TP
\fB\-\-perl\fR
Create a basic template for a Perl build\.
.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment