aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJosh Hagins2016-11-24 12:16:42 -0500
committerGitHub2016-11-24 12:16:42 -0500
commit949a3b62e7340d1bc0eacbdfe3b29ea55ef2f86d (patch)
tree2bf30fbe3c8c26c244f29048c5ac4efed31e9e04 /Library
parentf8aa057b07013ad8d86e8db562a96439104693ff (diff)
parent63e7fb5cae12ad751b4f3f83f6aa767d7c3c9f00 (diff)
downloadbrew-949a3b62e7340d1bc0eacbdfe3b29ea55ef2f86d.tar.bz2
Merge pull request #1547 from umireon/cask-uninstall-symlink
cask: Delete package dir if it is symlink on the uninstall
Diffstat (limited to 'Library')
-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)