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
This commit is contained in:
Mike McQuaid
2018-04-01 09:27:49 +01:00
parent 60d6b4d90d
commit 5dfa0cf622
+3 -1
View File
@@ -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|