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.
This commit is contained in:
parent
e1bab7ede9
commit
a6fa2f367b
@ -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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user