chore(formula): raise error if no universal binaries are found to deuniversalize

Signed-off-by: Rui Chen <rui@chenrui.dev>
This commit is contained in:
Rui Chen 2024-12-10 09:24:27 -05:00
parent 03d29a5743
commit 52569372bb
No known key found for this signature in database
GPG Key ID: 6577287BDCA70840

View File

@ -2005,6 +2005,8 @@ class Formula
# If called with no parameters, does this with all compatible # If called with no parameters, does this with all compatible
# universal binaries in a {Formula}'s {Keg}. # universal binaries in a {Formula}'s {Keg}.
# #
# Raises an error if no universal binaries are found to deuniversalize.
#
# @api public # @api public
sig { params(targets: T.nilable(T.any(Pathname, String))).void } sig { params(targets: T.nilable(T.any(Pathname, String))).void }
def deuniversalize_machos(*targets) def deuniversalize_machos(*targets)
@ -2014,6 +2016,8 @@ class Formula
end end
end end
raise "No universal binaries found to deuniversalize" if targets.blank?
targets&.each do |target| targets&.each do |target|
extract_macho_slice_from(Pathname(target), Hardware::CPU.arch) extract_macho_slice_from(Pathname(target), Hardware::CPU.arch)
end end