Fix Duplicate Upgrade Prompt in CLI · Entire
Entire CLI Upgrade Issue
I just tried to upgrade our CLI via the entire-upgrade plugin. It shells out to Homebrew to perform the upgrade. But what's weird is at the end, the CLI asked me again "do you want to upgrade", which caused a no-op. I wonder if what's happening is that the final summary is shelling out to entire --version or something, which triggers the upgrade check. Here’s the transcript:
09:37:45 (git) main▲ $ entire upgrade --nightly --yes
Detected Entire CLI (homebrew install):
entire 0.8.43-nightly.202607081321.e009b7501 at /opt/homebrew/bin/entire
git-remote-entire 0.8.43-nightly.202607081321.e009b7501 at /opt/homebrew/bin/git-remote-entire
Latest nightly build is 0.8.43-nightly.202607110651.7cd666280
==> Auto-updating Homebrew...
Adjust how often this is run with `$HOMEBREW_AUTO_UPDATE_SECS` or disable with
`$HOMEBREW_NO_AUTO_UPDATE=1`. Hide these hints with `$HOMEBREW_NO_ENV_HINTS=1` (see `man brew`).
==> Auto-updated Homebrew!
==> Updated Homebrew from 20901df0fa to 08a972812c.
Updated 3 taps (entireio/tap, homebrew/core and homebrew/cask).
==> New Formulae
==> Downloading [https://formulae.brew.sh/api/formula.jws.json](https://formulae.brew.sh/api/formula.jws.json)
\[... elided ...\]
You have 9 outdated formulae and 6 outdated casks installed.
==> Updating Homebrew...
Already up-to-date.
==> Would upgrade 1 outdated package
entireio/tap/entire@nightly 0.8.43-nightly.202607081321.e009b7501 -> 0.8.43-nightly.202607110651.7cd666280
==> Do you want to proceed with the upgrade? [y/n]
==> Upgrading 1 outdated package:
entireio/tap/entire@nightly 0.8.43-nightly.202607081321.e009b7501 -> 0.8.43-nightly.202607110651.7cd666280
==> Fetching downloads for: entireio/tap/entire@nightly
✔︎ Cask entire@nightly (0.8.43-nightly.202607110651.7cd666280) Downloaded 20.2MB/ 20.2MB
==> Upgrading entire@nightly
0.8.43-nightly.202607081321.e009b7501 -> 0.8.43-nightly.202607110651.7cd666280
==> Unlinking Binary '/opt/homebrew/bin/entire'
==> Unlinking Binary '/opt/homebrew/bin/git-remote-entire'
==> Linking Binary 'entire' to '/opt/homebrew/bin/entire'
==> Linking Binary 'git-remote-entire' to '/opt/homebrew/bin/git-remote-entire'
==> Purging files for version 0.8.43-nightly.202607081321.e009b7501 of Cask entire@nightly
🍺 entire@nightly was successfully upgraded!
==> Upgraded 1 outdated package
entireio/tap/entire@nightly 0.8.43-nightly.202607081321.e009b7501 -> 0.8.43-nightly.202607110651.7cd666280
Entire CLI upgrade complete (homebrew install):
entire 0.8.43-nightly.202607110651.7cd666280 installed to /opt/homebrew/bin/entire
git-remote-entire 0.8.43-nightly.202607110651.7cd666280 installed to /opt/homebrew/bin/git-remote-entire
Updating Entire CLI: brew upgrade --yes entire@nightly
✔︎ JSON API packages.arm64_tahoe.jws.json Downloaded 15.2MB/ 15.2MB
Warning: Not upgrading entire@nightly, the latest version is already installed
Update complete. Re-run entire to use the new version.
Root Cause
Root-caused it — your hypothesis is close but the mechanism is different: nothing shells out to entire --version. It's the parent entire process's own post-command version check, running with its stale compiled-in version.
What Happened, Step by Step:
upgradeisn't a built-in, so the old binary dispatched to theentire-upgradeplugin. The plugin ran brew and successfully upgraded the binary on disk.- When the plugin exits 0, the parent mirrors Cobra's
PersistentPostRunand runs the version check. But that parent process is still the old binary, so the version check sees the pre-upgrade version baked in at compile time. - Your 24h check cache had expired, so it fetched the latest nightly, saw
202607081321 < 202607110651and indicated