Port Homebrew::DevCmd::DispatchBuildBottle
This commit is contained in:
parent
19f9c52652
commit
21c84553cf
@ -1,15 +1,14 @@
|
||||
# typed: true
|
||||
# typed: strict
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "abstract_command"
|
||||
require "cli/parser"
|
||||
require "utils/github"
|
||||
|
||||
module Homebrew
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
def dispatch_build_bottle_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
module DevCmd
|
||||
class DispatchBuildBottle < AbstractCommand
|
||||
cmd_args do
|
||||
description <<~EOS
|
||||
Build bottles for these formulae with GitHub Actions.
|
||||
EOS
|
||||
@ -35,11 +34,9 @@ module Homebrew
|
||||
conflicts "--linux", "--linux-self-hosted"
|
||||
named_args :formula, min: 1
|
||||
end
|
||||
end
|
||||
|
||||
def dispatch_build_bottle
|
||||
args = dispatch_build_bottle_args.parse
|
||||
|
||||
sig { override.void }
|
||||
def run
|
||||
tap = Tap.fetch(args.tap || CoreTap.instance.name)
|
||||
user, repo = tap.full_name.split("/")
|
||||
ref = "master"
|
||||
@ -92,3 +89,5 @@ module Homebrew
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "cmd/shared_examples/args_parse"
|
||||
require "dev-cmd/dispatch-build-bottle"
|
||||
|
||||
RSpec.describe "brew dispatch-build-bottle" do
|
||||
it_behaves_like "parseable arguments"
|
||||
RSpec.describe Homebrew::DevCmd::DispatchBuildBottle do
|
||||
it_behaves_like "parseable arguments", argv: ["foo"]
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user