From 5dfa0cf622bbaae4fc3f7ebfd4d90c19c684a9a5 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 1 Apr 2018 09:27:49 +0100 Subject: [PATCH] keg: delete bad tap opt non-symlink directories. But don't delete them if they are a symlink to a directory i.e. a normal opt link. Handles the issue mentioned in https://github.com/Homebrew/brew/commit/1651647a3dc9dbc03ed3c5da06090228db4cd1a0#r28360427 --- Library/Homebrew/keg.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb index 04c98c9556..d40be299c1 100644 --- a/Library/Homebrew/keg.rb +++ b/Library/Homebrew/keg.rb @@ -238,7 +238,9 @@ class Keg if tap bad_tap_opt = opt/tap.user - FileUtils.rm_rf bad_tap_opt if bad_tap_opt.directory? + if !bad_tap_opt.symlink? && bad_tap_opt.directory? + FileUtils.rm_rf bad_tap_opt + end end aliases.each do |a|