diff options
| author | Kaito Udagawa | 2016-11-22 03:08:10 +0900 |
|---|---|---|
| committer | Kaito Udagawa | 2016-11-22 03:10:42 +0900 |
| commit | 63e7fb5cae12ad751b4f3f83f6aa767d7c3c9f00 (patch) | |
| tree | 135e7e3c5bb6777eec89223d3809b5bac73be14f /Library/Homebrew/cask | |
| parent | c7267b123d38d1c96c2ca786c942255d2417cd86 (diff) | |
| download | brew-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.rb | 7 |
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) |
