Repository navigation
fix: remove a stale .new before every update - #14
Merged
Merged
Conversation
Contributor
Author
|
This change is part of the following stack: Change managed by git-spice. |
An install interrupted between writing .new and renaming it left the file beside the binary, where it showed up in tab completion until the next release shipped. Update now asks an installer that implements the new Sweeper interface to remove it before the release check, so the cleanup runs even when nothing is available. Only a regular file by that name is removed.
bfirestone
force-pushed
the
fix/sweep-stale-new
branch
from
September 9, 2026 03:53
d3ab901 to
0844315
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An install interrupted between writing
<target>.newand renaming it into place left that file beside the binary. Tab completion then offeredmyappandmyapp.newuntil the next release shipped, since onlyreplaceFileever touched the name.Updatenow calls a new optionalSweeperinterface before the release check.ArchiveInstallerimplements it by removing<target>.newwhen it is a regular file. A directory or symlink by that name is left alone, since the suffix is ours only by convention. Running before the check means the cleanup happens even when nothing new is available or the network is down. A sweep failure prints a warning and the update proceeds.replaceFilealso removes a stale file before writing, for callers that drive the installer withoutUpdater.Verify with
go test -race -count=1 ./...andgolangci-lint run ./....