Add warnings for permission exceptions.

This commit is contained in:
Markus Reiter 2018-08-05 16:03:21 +02:00
parent e0e750e458
commit dca5dc8176

View File

@ -199,9 +199,17 @@ module Homebrew
target = HOMEBREW_CACHE/"#{prefix}--#{suffix}" target = HOMEBREW_CACHE/"#{prefix}--#{suffix}"
if target.exist? if target.exist?
FileUtils.rm_rf child begin
FileUtils.rm_rf child
rescue Errno::EACCES
opoo "Could not remove #{child}, please do so manually."
end
else else
FileUtils.mv child, target, force: true begin
FileUtils.mv child, target
rescue Errno::EACCES
opoo "Could not move #{child} to #{target}, please do so manually."
end
end end
end end
end end