From 4dce389aa7f9ead5cf8e64cfde446b1c6b16ce2e Mon Sep 17 00:00:00 2001 From: apainintheneck Date: Sun, 5 Jun 2022 13:00:20 -0700 Subject: [PATCH] Remove download sha file from .metadata dir when uninstalling casks --- Library/Homebrew/cask/installer.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/cask/installer.rb b/Library/Homebrew/cask/installer.rb index b0182cb42c..ed69a5f5ce 100644 --- a/Library/Homebrew/cask/installer.rb +++ b/Library/Homebrew/cask/installer.rb @@ -403,7 +403,10 @@ module Cask def uninstall oh1 "Uninstalling Cask #{Formatter.identifier(@cask)}" uninstall_artifacts(clear: true) - remove_config_file if !reinstall? && !upgrade? + if !reinstall? && !upgrade? + remove_download_sha + remove_config_file + end purge_versioned_files purge_caskroom_path if force? end @@ -413,6 +416,10 @@ module Cask @cask.config_path.parent.rmdir_if_possible end + def remove_download_sha + FileUtils.rm_f @cask.download_sha_path if @cask.download_sha_path.exist? + end + def start_upgrade uninstall_artifacts backup