Don’t clean up symlink target.

This commit is contained in:
Markus Reiter 2018-08-25 22:06:24 +02:00
parent b63ac557bc
commit 2773ce6156

View File

@ -230,14 +230,7 @@ module Homebrew
next cleanup_path(path) { FileUtils.rm_rf path } if path.nested_cache? next cleanup_path(path) { FileUtils.rm_rf path } if path.nested_cache?
if path.prune?(days) if path.prune?(days)
if path.symlink? if path.file? || path.symlink?
resolved_path = path.resolved_path
cleanup_path(path) do
resolved_path.unlink if resolved_path.exist?
path.unlink
end
elsif path.file?
cleanup_path(path) { path.unlink } cleanup_path(path) { path.unlink }
elsif path.directory? && path.to_s.include?("--") elsif path.directory? && path.to_s.include?("--")
cleanup_path(path) { FileUtils.rm_rf path } cleanup_path(path) { FileUtils.rm_rf path }