Rosetta audit: Build full executable path

The method only returned the executable name and not the full path,
leading to a swallowed error, because brew gracefully ignores a
failing lipo command.
This commit is contained in:
Lukas Eipert 2024-08-21 13:19:57 +02:00
parent 4362955bfc
commit 915917f4d2

View File

@ -751,7 +751,12 @@ module Cask
return unless File.exist?(plist_path) return unless File.exist?(plist_path)
plist = system_command!("plutil", args: ["-convert", "xml1", "-o", "-", plist_path]).plist plist = system_command!("plutil", args: ["-convert", "xml1", "-o", "-", plist_path]).plist
plist["CFBundleExecutable"].presence binary = plist["CFBundleExecutable"].presence
return unless binary
binary_path = "#{path}/Contents/MacOS/#{binary}"
binary_path if File.exist?(binary_path) && File.executable?(binary_path)
end end
sig { void } sig { void }