Skip to content

Commit

Permalink
livecheck: add --no-extract-plist
Browse files Browse the repository at this point in the history
  • Loading branch information
razvanazamfirei committed Mar 20, 2024
1 parent 91d670c commit 2106559
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Library/Homebrew/dev-cmd/livecheck.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ def livecheck_args
description: "Only check formulae."
switch "--cask", "--casks",
description: "Only check casks."
switch "--no-extract-plist",
description: "Exclude casks using the ExtractPlist livecheck strategy."

conflicts "--debug", "--json"
conflicts "--tap=", "--eval-all", "--installed"
conflicts "--cask", "--formula"
conflicts "--formula", "--no-extract-plist"

named_args [:formula, :cask], without_api: true
end
Expand Down Expand Up @@ -128,6 +131,7 @@ def livecheck
quiet: args.quiet?,
debug: args.debug?,
verbose: args.verbose?,
no_extract_plist: args.no_extract_plist?,
}.compact

Livecheck.run_checks(formulae_and_casks_to_check, **options)
Expand Down
15 changes: 14 additions & 1 deletion Library/Homebrew/livecheck/livecheck.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,13 @@ def resolve_livecheck_reference(
debug: T::Boolean,
quiet: T::Boolean,
verbose: T::Boolean,
no_extract_plist: T::Boolean,
).void
}
def run_checks(
formulae_and_casks_to_check,
full_name: false, handle_name_conflict: false, check_resources: false, json: false, newer_only: false,
debug: false, quiet: false, verbose: false
debug: false, quiet: false, verbose: false, no_extract_plist: false
)
load_other_tap_strategies(formulae_and_casks_to_check)

Expand Down Expand Up @@ -237,6 +238,18 @@ def run_checks(
puts
end

if cask && no_extract_plist && formula_or_cask.livecheck.strategy == :extract_plist
skip_info = {
cask: cask.token.to_s,
status: "skipped",
messages: ["Livecheck skipped due to --no-plist"],
meta: { livecheckable: true },
}

SkipConditions.print_skip_information(skip_info) if !newer_only && !quiet
next
end

# Check skip conditions for a referenced formula/cask
if referenced_formula_or_cask
skip_info = SkipConditions.referenced_skip_information(
Expand Down

0 comments on commit 2106559

Please sign in to comment.