Skip to content

Commit

Permalink
Merge pull request #18789 from bevanjkay/generate-cask-ci-matrix-syntax
Browse files Browse the repository at this point in the history
generate-cask-ci-matrix-syntax: allow no argument for syntax-only jobs
  • Loading branch information
MikeMcQuaid authored Nov 19, 2024
2 parents ad2e330 + 7c5e59e commit c81cd0b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Library/Homebrew/dev-cmd/generate-cask-ci-matrix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class GenerateCaskCiMatrix < AbstractCommand
conflicts "--syntax-only", "--skip-install"
conflicts "--syntax-only", "--new"

named_args [:cask, :url], min: 1
named_args [:cask, :url], min: 0
hide_from_man_page!
end

Expand All @@ -61,7 +61,10 @@ def run

tap = T.let(Tap.fetch(repository), Tap)

raise UsageError, "Either `--cask` or `--url` must be specified." if casks.blank? && pr_url.blank?
unless syntax_only
raise UsageError, "Either `--cask` or `--url` must be specified." if !args.casks? && !args.url?
raise UsageError, "Please provide a cask or url argument" if casks.blank? && pr_url.blank?
end
raise UsageError, "Only one url can be specified" if pr_url&.count&.> 1

labels = if pr_url
Expand Down

0 comments on commit c81cd0b

Please sign in to comment.