aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib
diff options
context:
space:
mode:
authorMarkus Reiter2017-06-24 08:34:01 +0200
committerMarkus Reiter2017-06-24 09:15:37 +0200
commitf24fc423624d25472786eac054948feb3430ce63 (patch)
tree55f6e45d701e5c741a11269282c9a0befda2260b /Library/Homebrew/cask/lib
parenta1f9032b9574dcb27b34a6deb4c9730839daf0df (diff)
downloadbrew-f24fc423624d25472786eac054948feb3430ce63.tar.bz2
🔥 Remove test files after trashing.
Diffstat (limited to 'Library/Homebrew/cask/lib')
-rw-r--r--Library/Homebrew/cask/lib/hbc/artifact/uninstall_base.rb18
1 files changed, 16 insertions, 2 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/artifact/uninstall_base.rb b/Library/Homebrew/cask/lib/hbc/artifact/uninstall_base.rb
index d3bd5ded1..d574adee3 100644
--- a/Library/Homebrew/cask/lib/hbc/artifact/uninstall_base.rb
+++ b/Library/Homebrew/cask/lib/hbc/artifact/uninstall_base.rb
@@ -234,13 +234,27 @@ module Hbc
ohai "Trashing files:"
puts resolved_paths.map(&:first)
- @command.run!("/usr/bin/osascript", args: ["-e", <<-EOS.undent, *resolved_paths.flat_map(&:last)])
+ trash_paths(*resolved_paths.flat_map(&:last))
+ end
+
+ def trash_paths(*paths)
+ @command.run!("/usr/bin/osascript", args: ["-e", <<-'EOS'.undent, *paths])
on run argv
repeat with i from 1 to (count argv)
set item i of argv to (item i of argv as POSIX file)
end repeat
- tell application "Finder" to move argv to trash
+ tell application "Finder"
+ set trashedItems to (move argv to trash)
+ set output to ""
+
+ repeat with i from 1 to (count trashedItems)
+ set item i of trashedItems to POSIX path of (item i of trashedItems as string)
+ set output to output & (item i of trashedItems) & (do shell script "printf \"\\0\"")
+ end repeat
+
+ return output
+ end tell
end run
EOS
end