cask: Delete package dir if it is symlink on the uninstall
When a Formula is converted into a Cask (e.g. osxfuse), a symlink remains at the place of package dir. This change ensure to remove such leftovers.
This commit is contained in:
parent
c7267b123d
commit
63e7fb5cae
@ -72,7 +72,12 @@ module Hbc
|
||||
end
|
||||
|
||||
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
|
||||
|
||||
def _with_full_permissions(path)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user