orbstack: Add hooks and more complete uninstall/zap (#143807)

* orbstack: Add hooks and more complete uninstall/zap

- Add postflight hook to complete update as discussed in #143806. Does nothing on first install.
- Add uninstall and zap hooks for VM cleanup (does nothing in v0.5.0 and v0.5.1, but already implemented for future versions)
- Clean up GUI app state in ~/Library on zap. (`macvirt` is the project's codename)

* orbstack: Remove ~/OrbStack mount if empty

When OrbStack is running, Docker volumes and Linux files are mounted at ~/OrbStack.

If it's not empty, users may have accidentally stored data there while it wasn't mounted, so leave it alone

* orbstack: Remove zap script

Doesn't work because it runs after uninstall. The uninstall script is enough.
This commit is contained in:
Danny Lin
2023-03-28 08:12:57 +11:00
committed by GitHub
parent 17d3aae66d
commit 10a2714ead
+25 -1
View File
@@ -21,5 +21,29 @@ cask "orbstack" do
app "OrbStack.app"
zap trash: "~/.orbstack"
postflight do
system_command "#{appdir}/OrbStack.app/Contents/MacOS/bin/orbctl",
args: ["_internal", "brew-postflight"]
end
uninstall script: {
executable: "#{appdir}/OrbStack.app/Contents/MacOS/bin/orbctl",
args: ["_internal", "brew-uninstall"],
}
zap trash: [
"~/.orbstack",
"~/Library/Caches/dev.kdrag0n.MacVirt",
"~/Library/HTTPStorages/dev.kdrag0n.MacVirt",
"~/Library/Preferences/dev.krag0n.MacVirt.plist",
"~/Library/WebKit/dev.kdrag0n.MacVirt",
"~/Library/Saved Application State/dev.kdrag0n.MacVirt.savedState",
],
rmdir: [
"~/OrbStack",
]
caveats <<~EOS
Open the OrbStack app to finish setup.
EOS
end