aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorRaymond Wanyoike2016-12-05 12:08:55 +0300
committerRaymond Wanyoike2016-12-05 12:08:55 +0300
commit0d67e35fb7b2db8157cc6650f31e601875073b42 (patch)
tree4fe4d66d5d02443b4b786d4142c61ba8dee9c904 /Library
parent55ef924e7a9f99a9df1c2b7a9b33793f7ae27d8a (diff)
downloadbrew-0d67e35fb7b2db8157cc6650f31e601875073b42.tar.bz2
cask reinstall: use fetch and stage steps from #1620
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/reinstall.rb28
1 files changed, 5 insertions, 23 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cli/reinstall.rb b/Library/Homebrew/cask/lib/hbc/cli/reinstall.rb
index 70a329c20..30d9b694c 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/reinstall.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/reinstall.rb
@@ -12,19 +12,8 @@ module Hbc
skip_cask_deps: skip_cask_deps,
require_sha: require_sha)
installer.print_caveats
+ installer.fetch
- # Download
- begin
- installer.satisfy_dependencies
- installer.verify_has_sha if @require_sha && !@force
- installer.download
- installer.verify
- rescue StandardError => e
- installer.purge_versioned_files
- raise e
- end
-
- # Uninstall
if cask.installed?
# use copy of cask for uninstallation to avoid 'No such file or directory' bug
installed_cask = cask
@@ -44,18 +33,11 @@ module Hbc
Installer.new(installed_cask, force: true).uninstall
end
- # Reinstall
- begin
- installer.extract_primary_container
- installer.install_artifacts
- installer.save_caskfile
- installer.enable_accessibility_access
- rescue StandardError => e
- installer.purge_versioned_files
- raise e
- end
-
+ installer.stage
+ installer.install_artifacts
+ installer.enable_accessibility_access
puts installer.summary
+
count += 1
rescue CaskUnavailableError => e
warn_unavailable_with_suggestion cask_token, e