From a6fa2f367bc4c7c6250d875b117de3ef6815a4b4 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 31 Aug 2017 12:17:01 +0100 Subject: [PATCH] Don't fail to migrate repo because of empty dir I just ran into an issue where a colleague's Homebrew couldn't update. It seems to have been because it failed once just after the new repo directory was created. Since there was nothing in this directory, there really isn't any reason for us to fail here, so to avoid this problem in the future, try to `rmdir` the directory before failing because it already exists. --- Library/Homebrew/cmd/update-report.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb index ea915f99cf..164413cd12 100644 --- a/Library/Homebrew/cmd/update-report.rb +++ b/Library/Homebrew/cmd/update-report.rb @@ -203,6 +203,7 @@ module Homebrew end new_homebrew_repository = Pathname.new "/usr/local/Homebrew" + new_homebrew_repository.rmdir_if_possible if new_homebrew_repository.exist? ofail <<-EOS.undent #{new_homebrew_repository} already exists.