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 << "-r" if args.r?
|
||||||
ls_args << "-t" if args.t?
|
ls_args << "-t" if args.t?
|
||||||
|
|
||||||
ohai "Formulae" if $stdout.tty? && !args.formula?
|
if HOMEBREW_CELLAR.exist? && HOMEBREW_CELLAR.children.any?
|
||||||
safe_system "ls", *ls_args, HOMEBREW_CELLAR
|
ohai "Formulae" if $stdout.tty? && !args.formula?
|
||||||
|
safe_system "ls", *ls_args, HOMEBREW_CELLAR
|
||||||
|
end
|
||||||
|
|
||||||
if !args.formula? && Cask::Caskroom.casks.any?
|
if !args.formula? && Cask::Caskroom.casks.any?
|
||||||
if $stdout.tty?
|
if $stdout.tty?
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user