aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMarkus Reiter2017-07-30 19:18:11 +0200
committerGitHub2017-07-30 19:18:11 +0200
commitae9d36b2dd9018d6e0f8a73b8cc38b2b3890d244 (patch)
treeb11c1847eda6efa28347bf3e51d6b2bce47e443a /Library
parent896f41f7edb2f55f79fd3b8e6ffc8f3f1497727b (diff)
parent0d1162d821a1382631e4789582a692e39aa9c059 (diff)
downloadbrew-ae9d36b2dd9018d6e0f8a73b8cc38b2b3890d244.tar.bz2
Merge pull request #2981 from reitermarkus/fix-trash
Fix trash script.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cask/lib/hbc/artifact/uninstall_base.rb7
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/zap.rb4
2 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 695b5a950..d92644150 100644
--- a/Library/Homebrew/cask/lib/hbc/artifact/uninstall_base.rb
+++ b/Library/Homebrew/cask/lib/hbc/artifact/uninstall_base.rb
@@ -247,8 +247,11 @@ module Hbc
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\"")
+ 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\"")
+ end if
end repeat
return output
diff --git a/Library/Homebrew/cask/lib/hbc/cli/zap.rb b/Library/Homebrew/cask/lib/hbc/cli/zap.rb
index d12943106..e709f4191 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/zap.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/zap.rb
@@ -1,6 +1,8 @@
module Hbc
class CLI
class Zap < AbstractCommand
+ option "--force", :force, false
+
def initialize(*)
super
raise CaskUnspecifiedError if args.empty?
@@ -13,7 +15,7 @@ module Hbc
def zap_casks
casks.each do |cask|
odebug "Zapping Cask #{cask}"
- Installer.new(cask, verbose: verbose?).zap
+ Installer.new(cask, verbose: verbose?, force: force?).zap
end
end