From 212992a4764f2486880f2c6f9fbb6122e813ad29 Mon Sep 17 00:00:00 2001 From: Bevan Kay Date: Wed, 21 Jul 2021 16:09:09 +1000 Subject: [PATCH] fix typecheck, add reference in bump-unversioned-casks --- Library/Homebrew/dev-cmd/bump-unversioned-casks.rb | 2 +- Library/Homebrew/unversioned_cask_checker.rb | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/dev-cmd/bump-unversioned-casks.rb b/Library/Homebrew/dev-cmd/bump-unversioned-casks.rb index e0c44fad14..c5261809b9 100644 --- a/Library/Homebrew/dev-cmd/bump-unversioned-casks.rb +++ b/Library/Homebrew/dev-cmd/bump-unversioned-casks.rb @@ -91,7 +91,7 @@ module Homebrew unversioned_cask_checker = UnversionedCaskChecker.new(cask) - if !unversioned_cask_checker.single_app_cask? && !unversioned_cask_checker.single_pkg_cask? + if !unversioned_cask_checker.single_app_cask? && !unversioned_cask_checker.single_pkg_cask? && !unversioned_cask_checker.single_qlplugin_cask? opoo "Skipping, not a single-app or PKG cask." return end diff --git a/Library/Homebrew/unversioned_cask_checker.rb b/Library/Homebrew/unversioned_cask_checker.rb index 82a16aeec2..836d097a1b 100644 --- a/Library/Homebrew/unversioned_cask_checker.rb +++ b/Library/Homebrew/unversioned_cask_checker.rb @@ -46,6 +46,11 @@ module Homebrew apps.count == 1 end + sig { returns(T::Boolean) } + def single_qlplugin_cask? + qlplugins.count == 1 + end + sig { returns(T::Boolean) } def single_pkg_cask? pkgs.count == 1 @@ -83,8 +88,8 @@ module Homebrew installer.extract_primary_container(to: dir) - info_plist_paths = (apps + qlplugins).flat_map do |app| - top_level_info_plists(Pathname.glob(dir/"**"/app.source.basename/"Contents"/"Info.plist")).sort + info_plist_paths = (apps.concat(qlplugins)).flat_map do |artifact| + top_level_info_plists(Pathname.glob(dir/"**"/artifact.source.basename/"Contents"/"Info.plist")).sort end info_plist_paths.each(&parse_info_plist)