check for cask before unlinking during uninstall
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.
This commit is contained in:
parent
245a5fb33d
commit
a89494860a
|
@ -1,6 +1,7 @@
|
|||
class Anvil < Cask
|
||||
url 'http://anvilformac.com/download'
|
||||
url 'http://sparkler.herokuapp.com/apps/3/download'
|
||||
homepage 'http://anvilformac.com/'
|
||||
version 'latest'
|
||||
no_checksum
|
||||
link :app, 'Anvil.app'
|
||||
end
|
||||
|
|
|
@ -3,10 +3,11 @@ class Cask::CLI::Uninstall
|
|||
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 CaskUnavailableError,CaskNotInstalledError => e
|
||||
rescue CaskError => e
|
||||
onoe e
|
||||
end
|
||||
end
|
||||
|
|
|
@ -28,8 +28,6 @@ class Cask::Installer
|
|||
end
|
||||
|
||||
def uninstall(cask)
|
||||
raise CaskNotInstalledError.new(cask) unless cask.installed?
|
||||
|
||||
cask.destination_path.rmtree
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue