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? ==
 | 
					  alias eql? ==
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def empty_installation?
 | 
					  def empty_installation?
 | 
				
			||||||
    Pathname.glob("#{path}/**/*") do |file|
 | 
					    Pathname.glob("#{path}/*") do |file|
 | 
				
			||||||
      return false if file.executable?
 | 
					      return false if file.directory? && !file.children.reject(&:ds_store?).empty?
 | 
				
			||||||
      next if file.directory?
 | 
					 | 
				
			||||||
      basename = file.basename.to_s
 | 
					      basename = file.basename.to_s
 | 
				
			||||||
      next if Metafiles.copy?(basename)
 | 
					      next if Metafiles.copy?(basename)
 | 
				
			||||||
      next if %w[.DS_Store INSTALL_RECEIPT.json].include?(basename)
 | 
					      next if %w[.DS_Store INSTALL_RECEIPT.json].include?(basename)
 | 
				
			||||||
 | 
				
			|||||||
@ -59,6 +59,10 @@ class LinkTests < LinkTestCase
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    (@keg/"bin").rmtree
 | 
					    (@keg/"bin").rmtree
 | 
				
			||||||
    assert_predicate @keg, :empty_installation?
 | 
					    assert_predicate @keg, :empty_installation?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    (@keg/"bin").mkpath
 | 
				
			||||||
 | 
					    touch @keg.join("bin", "todo")
 | 
				
			||||||
 | 
					    refute_predicate @keg, :empty_installation?
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def test_linking_keg
 | 
					  def test_linking_keg
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user