From 8779784d7092b6f1175eaf8c780c4d3cc88b4b16 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sun, 30 Jul 2017 18:44:53 +0200 Subject: [PATCH 1/2] Fix trash script. --- Library/Homebrew/cask/lib/hbc/artifact/uninstall_base.rb | 7 +++++-- 1 file changed, 5 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 695b5a950b..d926441502 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 From 0d1162d821a1382631e4789582a692e39aa9c059 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sun, 30 Jul 2017 18:51:05 +0200 Subject: [PATCH 2/2] Make `zap` recognize `--force`. --- Library/Homebrew/cask/lib/hbc/cli/zap.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/cask/lib/hbc/cli/zap.rb b/Library/Homebrew/cask/lib/hbc/cli/zap.rb index d129431062..e709f41914 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