diff --git a/Library/Homebrew/dev-cmd/dispatch-build-bottle.rb b/Library/Homebrew/dev-cmd/dispatch-build-bottle.rb index f54ed792f5..ae9dfe0bb9 100644 --- a/Library/Homebrew/dev-cmd/dispatch-build-bottle.rb +++ b/Library/Homebrew/dev-cmd/dispatch-build-bottle.rb @@ -34,7 +34,7 @@ module Homebrew switch "--linux-wheezy", description: "Use Debian Wheezy container for building the bottle on Linux." - conflicts "--macos", "--linux", "--linux-self-hosted" + conflicts "--linux", "--linux-self-hosted" named_args :formula, min: 1 end end @@ -47,8 +47,10 @@ module Homebrew ref = "master" workflow = args.workflow || "dispatch-build-bottle.yml" - runners = if (macos = args.macos&.compact_blank) && macos.present? - macos.map do |element| + runners = [] + + if (macos = args.macos&.compact_blank) && macos.present? + runners += macos.map do |element| # We accept runner name syntax (11-arm64) or bottle syntax (arm64_big_sur) os, arch = element.yield_self do |s| tag = Utils::Bottles::Tag.from_symbol(s.to_sym) @@ -64,14 +66,16 @@ module Homebrew os.to_s end end - elsif args.linux? - ["ubuntu-latest"] - elsif args.linux_self_hosted? - ["linux-self-hosted-1"] - else - raise UsageError, "Must specify --macos or --linux or --linux-self-hosted option" end + if args.linux? + runners << "ubuntu-latest" + elsif args.linux_self_hosted? + runners << "linux-self-hosted-1" + end + + raise UsageError, "Must specify --macos or --linux or --linux-self-hosted option" if runners.empty? + args.named.to_resolved_formulae.each do |formula| # Required inputs inputs = { diff --git a/completions/zsh/_brew b/completions/zsh/_brew index 3d2a660fd3..f4f6709379 100644 --- a/completions/zsh/_brew +++ b/completions/zsh/_brew @@ -744,10 +744,10 @@ _brew_dispatch_build_bottle() { '--debug[Display any debugging information]' \ '--help[Show this message]' \ '--issue[If specified, post a comment to this issue number if the job fails]' \ - '(--macos --linux-self-hosted)--linux[Dispatch bottle for Linux (using GitHub runners)]' \ - '(--macos --linux)--linux-self-hosted[Dispatch bottle for Linux (using self-hosted runner)]' \ + '(--linux-self-hosted)--linux[Dispatch bottle for Linux (using GitHub runners)]' \ + '(--linux)--linux-self-hosted[Dispatch bottle for Linux (using self-hosted runner)]' \ '--linux-wheezy[Use Debian Wheezy container for building the bottle on Linux]' \ - '(--linux --linux-self-hosted)--macos[Version(s) of macOS the bottle should be built for]' \ + '--macos[Version(s) of macOS the bottle should be built for]' \ '--quiet[Make some output more quiet]' \ '--tap[Target tap repository (default: `homebrew/core`)]' \ '--timeout[Build timeout (in minutes, default: 60)]' \