diff options
| author | Joshua McKinney | 2017-03-27 01:31:29 -0500 |
|---|---|---|
| committer | Joshua McKinney | 2017-03-27 01:32:53 -0500 |
| commit | a90d1e169939cea7006f7465fe8c04370005223d (patch) | |
| tree | 236910b9c84898d9c98dbbb0070394143f55e767 /Library | |
| parent | 437db065caad8cb607373c41c3dc7bb2e3c58a66 (diff) | |
| download | brew-a90d1e169939cea7006f7465fe8c04370005223d.tar.bz2 | |
Installer#reinstall instead of #install :reinstall
Call an explicit method on Installer to reinstall rather than using a
flag to indicate when we're reinstalling a cask
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/cli/reinstall.rb | 3 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/installer.rb | 10 |
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 |
