Merge pull request #4116 from commitay/zap-force
Fix `zap --force` for uninstalled casks
This commit is contained in:
commit
2b6f477143
@ -58,7 +58,7 @@ module Hbc
|
||||
end
|
||||
|
||||
unless target.exist?
|
||||
return if skip
|
||||
return if skip || force
|
||||
raise CaskError, "It seems the #{self.class.english_name} source '#{target}' is not there."
|
||||
end
|
||||
|
||||
|
||||
@ -11,6 +11,9 @@ module Hbc
|
||||
def run
|
||||
casks.each do |cask|
|
||||
odebug "Zapping Cask #{cask}"
|
||||
|
||||
raise CaskNotInstalledError, cask unless cask.installed? || force?
|
||||
|
||||
Installer.new(cask, verbose: verbose?, force: force?).zap
|
||||
end
|
||||
end
|
||||
|
||||
@ -123,11 +123,11 @@ names, and other aspects of this manual are still subject to change.
|
||||
If `--greedy` is given then also upgrade the Casks having `auto_updates true`
|
||||
or `version :latest`.
|
||||
|
||||
* `zap` <token> [ <token> ... ]:
|
||||
* `zap` [--force] <token> [ <token> ... ]:
|
||||
Unconditionally remove _all_ files associated with the given Cask.
|
||||
With `--force`, zap even if the Cask does not appear to be currently installed.
|
||||
|
||||
Implicitly performs all actions associated with `uninstall`, even if
|
||||
the Cask does not appear to be currently installed.
|
||||
Implicitly performs all actions associated with `uninstall`.
|
||||
|
||||
Removes all staged versions of the Cask distribution found under
|
||||
`<Caskroom_path>/`<token>.
|
||||
|
||||
@ -118,11 +118,11 @@ Uninstall the given Cask\. With \fB\-\-force\fR, uninstall even if the Cask does
|
||||
Without token arguments, upgrade all the installed Casks that have newer versions available in the tap; otherwise update the tokens given in the command line\. If \fB\-\-greedy\fR is given then also upgrade the Casks having \fBauto_updates true\fR or \fBversion :latest\fR\.
|
||||
.
|
||||
.TP
|
||||
\fBzap\fR \fItoken\fR [ \fItoken\fR \.\.\. ]
|
||||
Unconditionally remove \fIall\fR files associated with the given Cask\.
|
||||
\fBzap\fR [\-\-force] \fItoken\fR [ \fItoken\fR \.\.\. ]
|
||||
Unconditionally remove \fIall\fR files associated with the given Cask\. With \fB\-\-force\fR, zap even if the Cask does not appear to be currently installed\.
|
||||
.
|
||||
.IP
|
||||
Implicitly performs all actions associated with \fBuninstall\fR, even if the Cask does not appear to be currently installed\.
|
||||
Implicitly performs all actions associated with \fBuninstall\fR\.
|
||||
.
|
||||
.IP
|
||||
Removes all staged versions of the Cask distribution found under \fB<Caskroom_path>/\fR\fItoken\fR\.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user