aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib/hbc/cli
diff options
context:
space:
mode:
authorMarkus Reiter2017-04-20 10:48:32 +0200
committerMarkus Reiter2017-04-21 01:28:21 +0200
commit1cd125e7e76fa4cc0edf5eb2428d705567cdfef7 (patch)
tree88cafd92d493415eeb2dc90b1ceb7f8cf6f37c87 /Library/Homebrew/cask/lib/hbc/cli
parent2be7999878702554f1e1b5f4118978e670e6156c (diff)
downloadbrew-1cd125e7e76fa4cc0edf5eb2428d705567cdfef7.tar.bz2
Refactor cask metadata directory methods.
Diffstat (limited to 'Library/Homebrew/cask/lib/hbc/cli')
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/uninstall.rb10
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