aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)