From a7b2da0fc410c8f6e140d7ee92e878d59896ef77 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 28 Jun 2024 08:33:20 +0100 Subject: [PATCH] cask/audit: use select instead of reject. Co-authored-by: Rylan Polster --- Library/Homebrew/cask/audit.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cask/audit.rb b/Library/Homebrew/cask/audit.rb index 5a67bbda83..5e9be9be37 100644 --- a/Library/Homebrew/cask/audit.rb +++ b/Library/Homebrew/cask/audit.rb @@ -580,8 +580,8 @@ module Cask result = case artifact when Artifact::App - files = Dir[path/"Contents/MacOS/*"].reject do |f| - !File.executable?(f) || File.directory?(f) || f.end_with?(".dylib") + files = Dir[path/"Contents/MacOS/*"].select do |f| + File.executable?(f) && !File.directory?(f) && !f.end_with?(".dylib") end add_error "No binaries in App: #{artifact.source}", location: cask.url.location if files.empty? system_command("lipo", args: ["-archs", files.first], print_stderr: false)