Don't clean up lockfiles if the directory doesn't exist

Fixes #20673.
This commit is contained in:
Jack Nagel committed 2013-06-21 18:38:39 -05:00
1 parent 2caa0854c7
commit f0dfea67f3
1 file changed
+1
+1
View File
@@ -84,6 +84,7 @@ module Homebrew extend self
end
def cleanup_lockfiles
return unless HOMEBREW_CACHE_FORMULA.directory?
candidates = HOMEBREW_CACHE_FORMULA.children
lockfiles = candidates.select { |f| f.file? && f.extname == '.brewing' }
lockfiles.select(&:readable?).each do |file|