Consider version of .apps containing installers.

This commit is contained in:
Markus Reiter 2023-04-03 04:53:18 +02:00
parent cf7a9df923
commit 6e5ab67838
No known key found for this signature in database
GPG Key ID: 245293B51702655B

View File

@ -122,8 +122,19 @@ module Homebrew
*installers,
*screen_savers,
].flat_map do |artifact|
source = artifact.is_a?(Cask::Artifact::Installer) ? artifact.path : artifact.source.basename
top_level_info_plists(Pathname.glob(dir/"**"/source/"Contents"/"Info.plist")).sort
sources = if artifact.is_a?(Cask::Artifact::Installer)
# Installers are sometimes contained within an `.app`, so try both.
installer_path = artifact.path
installer_path.ascend
.flat_map { |path| (path == installer_path || path.extname == ".app") ? [path] : [] }
.sort
else
[artifact.source.basename]
end
sources.flat_map do |source|
top_level_info_plists(Pathname.glob(dir/"**"/source/"Contents"/"Info.plist")).sort
end
end
info_plist_paths.each(&parse_info_plist)