Skip to content
Snippets Groups Projects
Commit ccc9b2dc authored by Naoto Kaneko's avatar Naoto Kaneko
Browse files

Check for metafiles only in the root directory

parent 56a0afe5
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment