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
commit612da7c3b087d31b9ffc0c0975431f89d9056ca8 (patch)
tree41d1f8aaecb7b9c09bc194d44dd9b127291d95f8 /Library/Homebrew
parent0d370bc3299a03e02a3335f4586e82cb3659948f (diff)
downloadbrew-612da7c3b087d31b9ffc0c0975431f89d9056ca8.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) }
}