Update brew ls
to work when the cellar doesn't exist
This commit is contained in:
parent
f1e512001a
commit
353fe2d322
@ -70,14 +70,6 @@ module Homebrew
|
|||||||
def list
|
def list
|
||||||
args = list_args.parse
|
args = list_args.parse
|
||||||
|
|
||||||
# Unbrewed uses the PREFIX, which will exist
|
|
||||||
# Things below use the CELLAR, which doesn't until the first formula is installed.
|
|
||||||
unless HOMEBREW_CELLAR.exist?
|
|
||||||
raise NoSuchKegError, args.named.first if args.named.present? && !args.cask?
|
|
||||||
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if args.full_name?
|
if args.full_name?
|
||||||
unless args.cask?
|
unless args.cask?
|
||||||
formula_names = args.no_named? ? Formula.installed : args.named.to_resolved_formulae
|
formula_names = args.no_named? ? Formula.installed : args.named.to_resolved_formulae
|
||||||
@ -112,12 +104,10 @@ module Homebrew
|
|||||||
if !args.cask? && HOMEBREW_CELLAR.exist? && HOMEBREW_CELLAR.children.any?
|
if !args.cask? && HOMEBREW_CELLAR.exist? && HOMEBREW_CELLAR.children.any?
|
||||||
ohai "Formulae" if $stdout.tty? && !args.formula?
|
ohai "Formulae" if $stdout.tty? && !args.formula?
|
||||||
safe_system "ls", *ls_args, HOMEBREW_CELLAR
|
safe_system "ls", *ls_args, HOMEBREW_CELLAR
|
||||||
|
puts if $stdout.tty? && !args.formula?
|
||||||
end
|
end
|
||||||
if !args.formula? && Cask::Caskroom.any_casks_installed?
|
if !args.formula? && Cask::Caskroom.any_casks_installed?
|
||||||
if $stdout.tty? && !args.cask?
|
ohai "Casks" if $stdout.tty? && !args.cask?
|
||||||
puts
|
|
||||||
ohai "Casks"
|
|
||||||
end
|
|
||||||
safe_system "ls", *ls_args, Cask::Caskroom.path
|
safe_system "ls", *ls_args, Cask::Caskroom.path
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user