Port Homebrew::DevCmd::DispatchBuildBottle

This commit is contained in:
Douglas Eichelberger 2024-03-21 08:13:35 -07:00
parent 19f9c52652
commit 21c84553cf
2 changed files with 78 additions and 78 deletions

View File

@ -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

View File

@ -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