From c111a5bc9dd3b9ca94d23b678f0ac9a8be955ace Mon Sep 17 00:00:00 2001 From: Mohammad Zain Abbas Date: Thu, 11 Aug 2022 21:00:28 +0200 Subject: [PATCH] Revert back changes + modified `resource_name` method --- Library/Homebrew/livecheck/livecheck.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/livecheck/livecheck.rb b/Library/Homebrew/livecheck/livecheck.rb index b50da24f14..2e2233e4d1 100644 --- a/Library/Homebrew/livecheck/livecheck.rb +++ b/Library/Homebrew/livecheck/livecheck.rb @@ -284,8 +284,8 @@ module Homebrew # Check current and latest resources (if "--resources" flag is given) # Only check current and latest versions if we have resources to check against - check_resources = check_resources && formula_or_cask.is_a?(Formula) && formula_or_cask.resources.present? - if check_resources + check_for_resources = check_resources && formula_or_cask.is_a?(Formula) && formula_or_cask.resources.present? + if check_for_resources resource_version_info = formula_or_cask.resources.map do |resource| resource_info = resource_version( resource, @@ -339,7 +339,7 @@ module Homebrew info[:meta][:head_only] = true if formula&.head_only? info[:meta].merge!(version_info[:meta]) if version_info.present? && version_info.key?(:meta) - info[:resources] = resource_version_info if check_resources + info[:resources] = resource_version_info if check_for_resources next if newer_only && !info[:version][:outdated] @@ -354,7 +354,7 @@ module Homebrew print_latest_version(info, verbose: verbose, ambiguous_cask: ambiguous_casks.include?(formula_or_cask), resource: false) - if check_resources + if check_for_resources resource_version_info.each do |r_info| print_latest_version( r_info, @@ -430,7 +430,7 @@ resource: false) # provided; returns the name otherwise. sig { params(resource: Resource, full_name: T::Boolean).returns(String) } def resource_name(resource, full_name: false) - full_name ? resource.download_name : resource.name + resource.name end sig {