diff options
| author | Markus Reiter | 2017-04-22 22:01:53 +0200 |
|---|---|---|
| committer | GitHub | 2017-04-22 22:01:53 +0200 |
| commit | 5bf0745ece76421b8be4e34619d25b3594190036 (patch) | |
| tree | 07fc69b9517d6763c426be98534dd5e74090b465 /Library/Homebrew/cask/lib/hbc/cli | |
| parent | 1ceb420bdd9b71e0cfddfe7b8998d2003c1bed7e (diff) | |
| parent | 1cd125e7e76fa4cc0edf5eb2428d705567cdfef7 (diff) | |
| download | brew-5bf0745ece76421b8be4e34619d25b3594190036.tar.bz2 | |
Merge pull request #2514 from reitermarkus/refactor-cask-metadata
Refactor cask metadata directory methods.
Diffstat (limited to 'Library/Homebrew/cask/lib/hbc/cli')
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/cli/uninstall.rb | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cli/uninstall.rb b/Library/Homebrew/cask/lib/hbc/cli/uninstall.rb index 6887aaf4f..1ee3230ad 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/uninstall.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/uninstall.rb @@ -12,15 +12,9 @@ module Hbc raise CaskNotInstalledError, cask unless cask.installed? || force - latest_installed_version = cask.timestamped_versions.last - - unless latest_installed_version.nil? - latest_installed_cask_file = cask.metadata_master_container_path - .join(latest_installed_version.join(File::Separator), - "Casks", "#{cask_token}.rb") - + if cask.installed? && !cask.installed_caskfile.nil? # use the same cask file that was used for installation, if possible - cask = CaskLoader.load_from_file(latest_installed_cask_file) if latest_installed_cask_file.exist? + cask = CaskLoader.load_from_file(cask.installed_caskfile) if cask.installed_caskfile.exist? end Installer.new(cask, force: force).uninstall |
