diff options
| author | Markus Reiter | 2017-06-16 17:01:30 +0200 |
|---|---|---|
| committer | Markus Reiter | 2017-06-20 15:53:33 +0200 |
| commit | b2daed584d6f8b737cc2b500eb19a38d02dbc8a6 (patch) | |
| tree | 5fc28c2f31cbdedbaf06b3ce3785b57337d0b2b0 | |
| parent | fc739bf82e263b54dca30713388f3ffd712aba6a (diff) | |
| download | brew-b2daed584d6f8b737cc2b500eb19a38d02dbc8a6.tar.bz2 | |
Add support for `uninstall/zap :trash`.
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/artifact/uninstall_base.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/artifact/uninstall_base.rb b/Library/Homebrew/cask/lib/hbc/artifact/uninstall_base.rb index 7dc772380..96243d201 100644 --- a/Library/Homebrew/cask/lib/hbc/artifact/uninstall_base.rb +++ b/Library/Homebrew/cask/lib/hbc/artifact/uninstall_base.rb @@ -224,9 +224,14 @@ module Hbc end def uninstall_trash(*paths) - # :trash functionality is stubbed as a synonym for :delete - # TODO: make :trash work differently, moving files to the Trash - uninstall_delete(*paths) + return if paths.empty? + + ohai "Trashing files:" + each_resolved_path(:trash, paths) do |path, resolved_paths| + puts path + resolved_paths.each { |resolved_path| Utils.gain_permissions(resolved_path, ["-R"], @command) } + @command.run!("/usr/bin/xargs", args: ["-0", "--", HOMEBREW_LIBRARY_PATH/"utils/trash.swift"], input: resolved_paths.join("\0")) + end end def uninstall_rmdir(*directories) |
