From 7c5e59e8a4ae3daaa3415f304f420e90c2450752 Mon Sep 17 00:00:00 2001 From: Bevan Kay Date: Tue, 19 Nov 2024 20:31:40 +1100 Subject: [PATCH] generate-cask-ci-matrix-syntax: allow no argument for syntax-only jobs --- Library/Homebrew/dev-cmd/generate-cask-ci-matrix.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/dev-cmd/generate-cask-ci-matrix.rb b/Library/Homebrew/dev-cmd/generate-cask-ci-matrix.rb index b248a88ed75bb..8e9406ca03fde 100644 --- a/Library/Homebrew/dev-cmd/generate-cask-ci-matrix.rb +++ b/Library/Homebrew/dev-cmd/generate-cask-ci-matrix.rb @@ -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 @@ -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