aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorJack Nagel2014-09-24 17:40:17 -0500
committerJack Nagel2014-09-24 17:40:17 -0500
commit30f21dfec9a8d5e4f14a06a655b07cf7c6d386d0 (patch)
treeb8eefc8f3c256d620148f4e74e6477a9d94f7ff7 /Library/Homebrew
parent97a826682d379147f739efeb765940f42eaa5f84 (diff)
downloadhomebrew-30f21dfec9a8d5e4f14a06a655b07cf7c6d386d0.tar.bz2
Make sure the directory exists before chdir
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/cmd/doctor.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index fddbf31fb..374b66c2e 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -104,6 +104,8 @@ def check_for_macgpg2
end
def __check_stray_files(dir, pattern, white_list, message)
+ return unless Dir.exist?(dir)
+
files = Dir.chdir(dir) {
Dir[pattern].select { |f| File.file?(f) && !File.symlink?(f) }
}