Print given argument instead of rename if matching keg not found

This commit is contained in:
fn ⌃ ⌥ 2021-11-24 11:37:34 -08:00
parent 3ab140e397
commit 9b611be759
3 changed files with 3 additions and 3 deletions

View File

@ -316,7 +316,7 @@ module Homebrew
rack = Formulary.to_rack(name.downcase) rack = Formulary.to_rack(name.downcase)
kegs = rack.directory? ? rack.subdirs.map { |d| Keg.new(d) } : [] kegs = rack.directory? ? rack.subdirs.map { |d| Keg.new(d) } : []
raise NoSuchKegError, rack.basename if kegs.none? raise NoSuchKegError, name if kegs.none?
[rack, kegs] [rack, kegs]
end end

View File

@ -29,7 +29,7 @@ module Homebrew
def migrate def migrate
args = migrate_args.parse args = migrate_args.parse
args.named.to_default_kegs.each do |keg| args.named.to_kegs.each do |keg|
f = Formulary.from_keg(keg) f = Formulary.from_keg(keg)
if f.oldname if f.oldname

View File

@ -36,7 +36,7 @@ module Homebrew
f = Formulary.from_rack(rack) f = Formulary.from_rack(rack)
if f.pinned? if f.pinned?
onoe "#{f.full_name} is pinned. You must unpin it to uninstall." onoe "#{f.full_name} is pinned. You must unpin it to uninstall."
next break # exit keg loop and move on to next rack
end end
rescue rescue
nil nil