Skip to content

fix: prune leftover update artifacts from the bin dir before updating#41

Merged
a-essawy merged 1 commit into
mainfrom
fix/update-prune-stale-leftovers
Jun 6, 2026
Merged

fix: prune leftover update artifacts from the bin dir before updating#41
a-essawy merged 1 commit into
mainfrom
fix/update-prune-stale-leftovers

Conversation

@a-essawy
Copy link
Copy Markdown
Contributor

@a-essawy a-essawy commented Jun 6, 2026

Sweeps stray update- archives, .rb-update-* dirs, and .new partials left by interrupted updates (notably the pre-1.3.2 Windows failure path) at the start of rb update. Best-effort; never touches .bak. Typecheck green. Also serves as the validation target for the 1.3.2 self-replace fix: lets a user on 1.3.2 update to 1.3.3 through the fixed code path.

The pre-1.3.2 updater extracted directly into the binary's directory and, when
it failed on Windows, could strand a partial `update-<ts>.zip` archive there.
A killed run of the current updater can likewise leave a `.rb-update-<ts>` temp
dir or a half-staged `.new` binary. None are ever reused, so they just
accumulate in the user's bin dir.

Sweep these at the start of an update: stray `update-<ts>.{zip,tar.gz}`
archives, `.rb-update-*` dirs, and `rb.new` / `rb.exe.new`. Best-effort and
wrapped in try/catch so cleanup never blocks the update. `.bak` is left alone —
it is the intentional one-version rollback.
@a-essawy a-essawy merged commit f05252c into main Jun 6, 2026
2 checks passed
@a-essawy a-essawy deleted the fix/update-prune-stale-leftovers branch June 6, 2026 22:36
@a-essawy a-essawy mentioned this pull request Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant