diff options
| author | Markus Reiter | 2017-10-01 01:47:08 +0200 |
|---|---|---|
| committer | Markus Reiter | 2017-10-01 22:19:07 +0200 |
| commit | 965ca015965bfb376cb20e40c2c534f9572edb37 (patch) | |
| tree | c25465a93ec5cdcf301120357a43eff3c4d092ff /Library | |
| parent | 55dd44efad8fcd45908de3d26dbef3fd12f17a20 (diff) | |
| download | brew-965ca015965bfb376cb20e40c2c534f9572edb37.tar.bz2 | |
Fix `brew tests` leaving last file in trash.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/artifact/abstract_uninstall.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/artifact/abstract_uninstall.rb b/Library/Homebrew/cask/lib/hbc/artifact/abstract_uninstall.rb index badd549ce..d0b2eb6ef 100644 --- a/Library/Homebrew/cask/lib/hbc/artifact/abstract_uninstall.rb +++ b/Library/Homebrew/cask/lib/hbc/artifact/abstract_uninstall.rb @@ -253,7 +253,7 @@ module Hbc end def trash_paths(*paths, command: nil, **_) - command.run!("/usr/bin/osascript", args: ["-e", <<-'EOS'.undent, *paths]) + result = 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) @@ -267,7 +267,7 @@ module Hbc set trashedItem to POSIX path of (item i of trashedItems as string) set output to output & trashedItem if i < count trashedItems then - set output to output & (do shell script "printf \"\\0\"") + set output to output & character id 0 end if end repeat @@ -275,6 +275,9 @@ module Hbc end tell end run EOS + + # Remove AppleScript's automatic newline. + result.tap { |r| r.stdout.sub!(/\n$/, "") } end def uninstall_rmdir(*directories, command: nil, **_) |
