diff --git a/Library/Homebrew/dev-cmd/bump-unversioned-casks.rb b/Library/Homebrew/dev-cmd/bump-unversioned-casks.rb index e0c44fad14..3caf75982b 100644 --- a/Library/Homebrew/dev-cmd/bump-unversioned-casks.rb +++ b/Library/Homebrew/dev-cmd/bump-unversioned-casks.rb @@ -91,7 +91,9 @@ 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 462d43990a..0f68c67a10 100644 --- a/Library/Homebrew/unversioned_cask_checker.rb +++ b/Library/Homebrew/unversioned_cask_checker.rb @@ -31,6 +31,11 @@ module Homebrew @apps ||= @cask.artifacts.select { |a| a.is_a?(Cask::Artifact::App) } end + sig { returns(T::Array[Cask::Artifact::Qlplugin]) } + def qlplugins + @qlplugins ||= @cask.artifacts.select { |a| a.is_a?(Cask::Artifact::Qlplugin) } + end + sig { returns(T::Array[Cask::Artifact::Pkg]) } def pkgs @pkgs ||= @cask.artifacts.select { |a| a.is_a?(Cask::Artifact::Pkg) } @@ -41,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 @@ -78,8 +88,8 @@ module Homebrew installer.extract_primary_container(to: dir) - info_plist_paths = apps.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) @@ -112,8 +122,8 @@ module Homebrew sig { returns(T.nilable(String)) } def guess_cask_version - if apps.empty? && pkgs.empty? - opoo "Cask #{cask} does not contain any apps or PKG installers." + if apps.empty? && pkgs.empty? && qlplugins.empty? + opoo "Cask #{cask} does not contain any apps, qlplugins or PKG installers." return end