diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 303c295..2736110 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -180,6 +180,21 @@ jobs: app "Vista.app" + # brew upgrade replaces the bundle but leaves the old process + # running the stale binary. `uninstall quit:` Cmd-Q's it during the + # upgrade and `postflight` relaunches the freshly installed one, so + # the new version is what's actually running afterwards. (Stanza + # order is Homebrew-canonical: postflight before uninstall.) + postflight do + # Launch on every install (Gordon's call — it's a menu-bar + # indexer, so starting it right away is the point). `|| true` + # keeps a failed launch (e.g. a headless/non-GUI install) from + # aborting the install itself. + system_command "/bin/sh", args: ["-c", "/usr/bin/open -a Vista || true"] + end + + uninstall quit: "com.gordonbeeming.vista" + zap trash: [ "~/Library/Application Support/Vista", "~/Library/Caches/com.gordonbeeming.vista", diff --git a/Scripts/package-for-homebrew.sh b/Scripts/package-for-homebrew.sh index 4e0c9d3..b4bda36 100755 --- a/Scripts/package-for-homebrew.sh +++ b/Scripts/package-for-homebrew.sh @@ -69,6 +69,16 @@ cask "vista" do app "Vista.app" + # Keep in sync with the CI cask in .github/workflows/build.yml. + # brew upgrade replaces the bundle but leaves the old process running the + # stale binary, so quit it on upgrade and relaunch the freshly installed + # one. `|| true` keeps a failed launch (headless install) non-fatal. + postflight do + system_command "/bin/sh", args: ["-c", "/usr/bin/open -a Vista || true"] + end + + uninstall quit: "com.gordonbeeming.vista" + zap trash: [ "~/Library/Application Support/Vista", "~/Library/Caches/com.gordonbeeming.vista",