未验证 提交 3d4f367b 编辑于 作者: Mike McQuaid's avatar Mike McQuaid 提交者: GitHub
浏览文件

Merge pull request #12419 from EricFromCanada/list-no-such-keg

list: raise NoSuchKegError if formula exists but isn't installed
...@@ -167,6 +167,8 @@ module Homebrew ...@@ -167,6 +167,8 @@ module Homebrew
raise TapFormulaOrCaskUnavailableError.new(tap, short_name) raise TapFormulaOrCaskUnavailableError.new(tap, short_name)
end end
raise NoSuchKegError, name if resolve_formula(name)
raise FormulaOrCaskUnavailableError, name raise FormulaOrCaskUnavailableError, name
end end
private :load_formula_or_cask private :load_formula_or_cask
......
...@@ -132,7 +132,7 @@ module Homebrew ...@@ -132,7 +132,7 @@ module Homebrew
system_command! "find", args: args.named.to_default_kegs.map(&:to_s) + %w[-not -type d -print], system_command! "find", args: args.named.to_default_kegs.map(&:to_s) + %w[-not -type d -print],
print_stdout: true print_stdout: true
else else
kegs, casks = args.named.to_formulae_to_casks(method: :default_kegs) kegs, casks = args.named.to_kegs_to_casks
kegs.each { |keg| PrettyListing.new keg } if kegs.present? kegs.each { |keg| PrettyListing.new keg } if kegs.present?
list_casks(casks, args: args) if casks.present? list_casks(casks, args: args) if casks.present?
......
支持 Markdown
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册