uninstall: style suggestions

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Anton Melnikov 2025-05-21 17:37:50 +02:00 committed by botantony
parent 3dad44c9f3
commit 2f10b1cd6e
No known key found for this signature in database
GPG Key ID: 7FE721557EA6AAD6

View File

@ -72,12 +72,12 @@ module Homebrew
maybe_paths = maybe_paths.reject do |path| maybe_paths = maybe_paths.reject do |path|
# Remove extension only if a file # Remove extension only if a file
# (f.e. directory with name "openssl@1.1" will be trimmed to "openssl@1") # (f.e. directory with name "openssl@1.1" will be trimmed to "openssl@1")
filename = if File.directory?(path) basename = if File.directory?(path)
File.basename(path) File.basename(path)
else else
File.basename(path, ".*") File.basename(path, ".*")
end end
excluded_names.include?(filename) excluded_names.include?(basename)
end end
maybe_paths -= paths if paths.present? maybe_paths -= paths if paths.present?
if maybe_paths.present? if maybe_paths.present?