aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/reinstall.rb3
-rw-r--r--Library/Homebrew/cask/lib/hbc/installer.rb10
2 files changed, 9 insertions, 4 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cli/reinstall.rb b/Library/Homebrew/cask/lib/hbc/cli/reinstall.rb
index c27fa9f2f..c2ed8f462 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/reinstall.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/reinstall.rb
@@ -10,8 +10,7 @@ module Hbc
Installer.new(cask,
force: force,
skip_cask_deps: skip_cask_deps,
- require_sha: require_sha,
- reinstall: true).install
+ require_sha: require_sha).reinstall
count += 1
rescue CaskUnavailableError => e
diff --git a/Library/Homebrew/cask/lib/hbc/installer.rb b/Library/Homebrew/cask/lib/hbc/installer.rb
index 69113e9fc..c9b6b4e53 100644
--- a/Library/Homebrew/cask/lib/hbc/installer.rb
+++ b/Library/Homebrew/cask/lib/hbc/installer.rb
@@ -18,13 +18,13 @@ module Hbc
PERSISTENT_METADATA_SUBDIRS = ["gpg"].freeze
- def initialize(cask, command: SystemCommand, force: false, skip_cask_deps: false, require_sha: false, reinstall: false)
+ def initialize(cask, command: SystemCommand, force: false, skip_cask_deps: false, require_sha: false)
@cask = cask
@command = command
@force = force
@skip_cask_deps = skip_cask_deps
@require_sha = require_sha
- @reinstall = reinstall
+ @reinstall = false
end
def self.print_caveats(cask)
@@ -94,6 +94,12 @@ module Hbc
puts summary
end
+ def reinstall
+ odebug "Hbc::Installer#reinstall"
+ @reinstall = true
+ install
+ end
+
def uninstall_if_neccessary
return unless @cask.installed? && @reinstall
installed_cask = @cask