cmd/list: list formulae only if one is installed
We need the `HOMEBREW_CELLAR.exist?` check to avoid errors in new installations, which may not have a `Cellar` directory.
This commit is contained in:
parent
a88d65acc7
commit
4dccc2ef7f
@ -116,8 +116,10 @@ module Homebrew
|
||||
ls_args << "-r" if args.r?
|
||||
ls_args << "-t" if args.t?
|
||||
|
||||
if HOMEBREW_CELLAR.exist? && HOMEBREW_CELLAR.children.any?
|
||||
ohai "Formulae" if $stdout.tty? && !args.formula?
|
||||
safe_system "ls", *ls_args, HOMEBREW_CELLAR
|
||||
end
|
||||
|
||||
if !args.formula? && Cask::Caskroom.casks.any?
|
||||
if $stdout.tty?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user