aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlyssa Ross2017-08-31 12:17:01 +0100
committerAlyssa Ross2017-08-31 12:17:01 +0100
commita6fa2f367bc4c7c6250d875b117de3ef6815a4b4 (patch)
tree347bbafce787b88d80f96813e59e8ed88b1f142b
parente1bab7ede9461a6d5c93fb7240ba5a1f3bf7a7fb (diff)
downloadbrew-a6fa2f367bc4c7c6250d875b117de3ef6815a4b4.tar.bz2
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.
-rw-r--r--Library/Homebrew/cmd/update-report.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb
index ea915f99c..164413cd1 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.