From 2445b687c6768e239cea7284939cb172066c155b Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Tue, 26 Sep 2023 10:08:54 +0300 Subject: [PATCH] Use any? to check for warning message and fix `brew style` --- Library/Homebrew/dev-cmd/edit.rb | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Library/Homebrew/dev-cmd/edit.rb b/Library/Homebrew/dev-cmd/edit.rb index f18403dbd8..a30bece9fd 100644 --- a/Library/Homebrew/dev-cmd/edit.rb +++ b/Library/Homebrew/dev-cmd/edit.rb @@ -114,17 +114,15 @@ module Homebrew fail_with_message(path, args.cask?) unless path.exist? end - expanded_paths.each do |path| - if (path.core_formula_path? || path.core_cask_path? || path.core_formula_tap? || path.core_cask_tap?) && + if expanded_paths.any? do |path| + (path.core_formula_path? || path.core_cask_path? || path.core_formula_tap? || path.core_cask_tap?) && !Homebrew::EnvConfig.no_install_from_api? && !Homebrew::EnvConfig.no_env_hints? - path_type = (path.core_cask_path? || path.core_cask_tap?) ? "casks" : "formulae" - opoo <<~EOS - `brew install` ignores locally edited #{path_type} if - HOMEBREW_NO_INSTALL_FROM_API is not set. - EOS - break - end + end + opoo <<~EOS + `brew install` ignores locally edited casks and formulae if + HOMEBREW_NO_INSTALL_FROM_API is not set. + EOS end expanded_paths end