Merge pull request #1547 from umireon/cask-uninstall-symlink

cask: Delete package dir if it is symlink on the uninstall
This commit is contained in:
Josh Hagins 2016-11-24 12:16:42 -05:00 committed by GitHub
commit 949a3b62e7

View File

@ -72,7 +72,12 @@ module Hbc
end end
def _rmdir(path) def _rmdir(path)
@command.run!("/bin/rmdir", args: ["--", path], sudo: true) if path.children.empty? return unless path.children.empty?
if path.symlink?
@command.run!("/bin/rm", args: ["-f", "--", path], sudo: true)
else
@command.run!("/bin/rmdir", args: ["--", path], sudo: true)
end
end end
def _with_full_permissions(path) def _with_full_permissions(path)