From 0ebb4f259aacc09f8b17b8bf8fbc131e4f5ae3f4 Mon Sep 17 00:00:00 2001 From: Gordon Beeming Date: Wed, 10 Jun 2026 10:20:23 +1000 Subject: [PATCH 1/2] Quit and relaunch Vista on Homebrew upgrade brew upgrade replaces the .app bundle but leaves the old process running the now-stale binary, so the new version isn't what's actually running until you quit and reopen by hand. Add two stanzas to the generated cask: uninstall quit: Cmd-Qs the app during the upgrade, and postflight relaunches the freshly installed one. Takes effect from the next release on: relaunch applies on the next upgrade (postflight runs from the installed cask), and quit-on-upgrade the upgrade after (the uninstall step reads the previously-installed cask). Co-authored-by: Claude Co-authored-by: GitButler --- .github/workflows/build.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 303c295..c2377c5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -180,6 +180,17 @@ 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 + system_command "/usr/bin/open", args: ["-a", "Vista"] + end + + uninstall quit: "com.gordonbeeming.vista" + zap trash: [ "~/Library/Application Support/Vista", "~/Library/Caches/com.gordonbeeming.vista", From 84c982f9f70c7ea079606737d233431bee51d6d6 Mon Sep 17 00:00:00 2001 From: Gordon Beeming Date: Wed, 10 Jun 2026 11:52:46 +1000 Subject: [PATCH 2/2] Address review: non-fatal relaunch, sync the manual cask generator - Make the postflight relaunch non-fatal (`open -a Vista || true`) so a headless / non-GUI install can't abort the cask install. Launching on every install (including first install) is intentional for a menu-bar indexer, so that behaviour stays. - Add the same quit + relaunch stanzas to Scripts/package-for-homebrew.sh, the manual cask generator, so a hand-run release doesn't emit a cask that drifts from the CI one. Co-authored-by: Claude Co-authored-by: GitButler --- .github/workflows/build.yml | 6 +++++- Scripts/package-for-homebrew.sh | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c2377c5..2736110 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -186,7 +186,11 @@ jobs: # the new version is what's actually running afterwards. (Stanza # order is Homebrew-canonical: postflight before uninstall.) postflight do - system_command "/usr/bin/open", args: ["-a", "Vista"] + # 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" 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",