Formula.racks: exclude empty rack

Fixes https://github.com/Homebrew/homebrew-bundle/issues/121

Closes Homebrew/homebrew#45879.

Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
Xu Cheng 2015-11-11 14:14:58 +08:00
parent 4d772042f7
commit 0d74967ceb

View File

@ -1052,7 +1052,9 @@ class Formula
# @private
def self.racks
@racks ||= if HOMEBREW_CELLAR.directory?
HOMEBREW_CELLAR.subdirs.reject(&:symlink?)
HOMEBREW_CELLAR.subdirs.reject do |rack|
rack.symlink? || rack.subdirs.empty?
end
else
[]
end