From 52569372bbd8a0712d152db6b9bcb016ca69b425 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Tue, 10 Dec 2024 09:24:27 -0500 Subject: [PATCH] chore(formula): raise error if no universal binaries are found to deuniversalize Signed-off-by: Rui Chen --- Library/Homebrew/formula.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 3ef26943da25b..bede10e37813d 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -2005,6 +2005,8 @@ def time # If called with no parameters, does this with all compatible # universal binaries in a {Formula}'s {Keg}. # + # Raises an error if no universal binaries are found to deuniversalize. + # # @api public sig { params(targets: T.nilable(T.any(Pathname, String))).void } def deuniversalize_machos(*targets) @@ -2014,6 +2016,8 @@ def deuniversalize_machos(*targets) end end + raise "No universal binaries found to deuniversalize" if targets.blank? + targets&.each do |target| extract_macho_slice_from(Pathname(target), Hardware::CPU.arch) end