Use any? to check for warning message and fix brew style

This commit is contained in:
Anatoli Babenia 2023-09-26 10:08:54 +03:00
parent d16e7e1f32
commit 2445b687c6

View File

@ -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"
end
opoo <<~EOS
`brew install` ignores locally edited #{path_type} if
`brew install` ignores locally edited casks and formulae if
HOMEBREW_NO_INSTALL_FROM_API is not set.
EOS
break
end
end
expanded_paths
end