Is there a way of seeing what `brew cask zap` does before it does it?

I'd like to see the results of

brew cask zap <something>

so I can decide whether I want it to do that before it does it. Is there anything equivalent to a --dry-run option, that I'm somehow missing? Or any other way of achieving the same results?


Solution 1:

There doesn't appear to be a way of doing a dry run of a brew cask zap command.

You could look at the recipe and work out from that what the command will do. According to the man page the command will...

Implicitly performs all actions associated with uninstall, even if the Cask does not appear to be currently installed.

Removes all staged versions of the Cask distribution found under /opt/homebrew-cask/Caskroom/

If the Cask definition contains a zap stanza, performs additional zap actions as defined there, such as removing local preference files. zap actions are variable, depending on the level of detail defined by the Cask author.

zap may remove resources which are shared between applications.

So running brew cask cat <something> and examining the uninstall stanza (and the zap stanza if it is present) should give you a general idea of the files that zap will remove.

Longer term you could request a "dry run" feature.