Post History
Homebrew has different commands for brew uninstall {package} to remove the executable(s) versus brew zap {package} which further performs arbitrary extra cleanup steps specified by the formula.[1] ...
#1: Initial revision
[Homebrew][] has different commands for `brew uninstall {package}` to remove the executable(s) versus `brew zap {package}` which further performs arbitrary extra cleanup steps specified by the formula.[^formula]
The zap steps are usually deletion of user data and caches, letting a user decide between just removing the application files or explicitly purging their history.
Here's the `zap` stanza [for Firefox][ff]:
```ruby
cask 'firefox' do
# ...
zap trash: [
"/Library/Logs/DiagnosticReports/firefox_*",
"~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/org.mozilla.firefox.sfl*",
"~/Library/Application Support/CrashReporter/firefox_*",
"~/Library/Application Support/Firefox",
"~/Library/Caches/Firefox",
"~/Library/Caches/Mozilla/updates/Applications/Firefox",
"~/Library/Caches/org.mozilla.crashreporter",
"~/Library/Caches/org.mozilla.firefox",
"~/Library/Preferences/org.mozilla.crashreporter.plist",
"~/Library/Preferences/org.mozilla.firefox.plist",
"~/Library/Saved Application State/org.mozilla.firefox.savedState",
"~/Library/WebKit/org.mozilla.firefox",
],
rmdir: [
"~/Library/Application Support/Mozilla", # May also contain non-Firefox data
"~/Library/Caches/Mozilla",
"~/Library/Caches/Mozilla/updates",
"~/Library/Caches/Mozilla/updates/Applications",
]
end
```
[^formula]: "Formula" is Homebrew's term for the code that specifies an installable package.
[homebrew]: https://brew.sh
[ff]: https://github.com/Homebrew/homebrew-cask/blob/main/Casks/f/firefox.rb
