aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask
diff options
context:
space:
mode:
authorKaito Udagawa2016-11-22 03:08:10 +0900
committerKaito Udagawa2016-11-22 03:10:42 +0900
commit63e7fb5cae12ad751b4f3f83f6aa767d7c3c9f00 (patch)
tree135e7e3c5bb6777eec89223d3809b5bac73be14f /Library/Homebrew/cask
parentc7267b123d38d1c96c2ca786c942255d2417cd86 (diff)
downloadbrew-63e7fb5cae12ad751b4f3f83f6aa767d7c3c9f00.tar.bz2
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.
Diffstat (limited to 'Library/Homebrew/cask')
-rw-r--r--Library/Homebrew/cask/lib/hbc/pkg.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/pkg.rb b/Library/Homebrew/cask/lib/hbc/pkg.rb
index eacd5157e..2fb634f24 100644
--- a/Library/Homebrew/cask/lib/hbc/pkg.rb
+++ b/Library/Homebrew/cask/lib/hbc/pkg.rb
@@ -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)