Check for metafiles only in the root directory
This commit is contained in:
parent
56a0afe579
commit
ccc9b2dc6d
@ -207,9 +207,8 @@ class Keg
|
||||
alias eql? ==
|
||||
|
||||
def empty_installation?
|
||||
Pathname.glob("#{path}/**/*") do |file|
|
||||
return false if file.executable?
|
||||
next if file.directory?
|
||||
Pathname.glob("#{path}/*") do |file|
|
||||
return false if file.directory? && !file.children.reject(&:ds_store?).empty?
|
||||
basename = file.basename.to_s
|
||||
next if Metafiles.copy?(basename)
|
||||
next if %w[.DS_Store INSTALL_RECEIPT.json].include?(basename)
|
||||
|
||||
@ -59,6 +59,10 @@ class LinkTests < LinkTestCase
|
||||
|
||||
(@keg/"bin").rmtree
|
||||
assert_predicate @keg, :empty_installation?
|
||||
|
||||
(@keg/"bin").mkpath
|
||||
touch @keg.join("bin", "todo")
|
||||
refute_predicate @keg, :empty_installation?
|
||||
end
|
||||
|
||||
def test_linking_keg
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user