mirror of
https://github.com/donl/homebrew-cask-versions.git
synced 2026-07-19 14:26:46 -06:00
this was exposed in #313 by @vitorgalvao in his attempt to update the anvil cask; by adding a link to that cask, (which just so happens to be the cask that we chose for our "already uninstalled message" test). the fix is simply to move the "already uninstalled" check *before* we start to unlink.
18 lines
428 B
Ruby
18 lines
428 B
Ruby
class Cask::CLI::Uninstall
|
|
def self.run(*cask_names)
|
|
begin
|
|
casks = cask_names.map { |cn| Cask.load(cn) }
|
|
casks.each do |cask|
|
|
raise CaskNotInstalledError.new(cask) unless cask.installed?
|
|
Cask::AppLinker.new(cask).unlink
|
|
Cask::Installer.uninstall(cask)
|
|
end
|
|
rescue CaskError => e
|
|
onoe e
|
|
end
|
|
end
|
|
|
|
def self.help
|
|
"uninstalls the cask of the given name"
|
|
end
|
|
end
|