aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/extend/pathname.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index 8465408fe..1ccbff51c 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -339,10 +339,12 @@ class Pathname
end
[self/:Formula, self/:HomebrewFormula, self].each do |d|
- d.children.map{ |child| child.relative_path_from(self) }.each do |pn|
- yield pn if pn.to_s =~ /.rb$/
+ if d.exist?
+ d.children.map{ |child| child.relative_path_from(self) }.each do |pn|
+ yield pn if pn.to_s =~ /.rb$/
+ end
break
- end if d.exist?
+ end
end
end
end