cmd/upgrade: fix Rubocop warnings.
This commit is contained in:
parent
cc526601cf
commit
2c5beb0eff
@ -35,7 +35,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
(ARGV.resolved_formulae - outdated).each do |f|
|
(ARGV.resolved_formulae - outdated).each do |f|
|
||||||
versions = f.installed_kegs.map { |keg| keg.version }
|
versions = f.installed_kegs.map(&:version)
|
||||||
if versions.empty?
|
if versions.empty?
|
||||||
onoe "#{f.full_name} not installed"
|
onoe "#{f.full_name} not installed"
|
||||||
else
|
else
|
||||||
@ -51,11 +51,11 @@ module Homebrew
|
|||||||
outdated -= pinned
|
outdated -= pinned
|
||||||
end
|
end
|
||||||
|
|
||||||
unless outdated.empty?
|
if outdated.empty?
|
||||||
|
oh1 "No packages to upgrade"
|
||||||
|
else
|
||||||
oh1 "Upgrading #{outdated.length} outdated package#{plural(outdated.length)}, with result:"
|
oh1 "Upgrading #{outdated.length} outdated package#{plural(outdated.length)}, with result:"
|
||||||
puts outdated.map { |f| "#{f.full_name} #{f.pkg_version}" } * ", "
|
puts outdated.map { |f| "#{f.full_name} #{f.pkg_version}" } * ", "
|
||||||
else
|
|
||||||
oh1 "No packages to upgrade"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
unless upgrade_pinned? || pinned.empty?
|
unless upgrade_pinned? || pinned.empty?
|
||||||
@ -116,6 +116,10 @@ module Homebrew
|
|||||||
ofail e
|
ofail e
|
||||||
ensure
|
ensure
|
||||||
# restore previous installation state if build failed
|
# restore previous installation state if build failed
|
||||||
outdated_keg.link if outdated_keg && !f.installed? rescue nil
|
begin
|
||||||
|
outdated_keg.link if outdated_keg && !f.installed?
|
||||||
|
rescue
|
||||||
|
nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user