Skip to content

fix(self-update): remove the download temp dir after replacing eget - #60

Merged
inhere merged 1 commit into
inherelab:masterfrom
MrBeldum:fix/self-update-temp-cleanup
Oct 6, 2026
Merged

inhere merged 1 commit into
inherelab:masterfrom
MrBeldum:fix/self-update-temp-cleanup

Conversation

@MrBeldum

@MrBeldum MrBeldum commented Oct 5, 2026

Copy link
Copy Markdown

eget update --self downloads into a fresh eget-self-update-* directory under the system temp dir, but nothing ever removed it, so one directory piled up per self-update (#59).

SelfUpdateService.Update now removes that directory when it returns, whether the update succeeded or failed. The one exception is a deferred replace (Windows): there the helper script still moves the extracted binary after eget exits, so the directory has to stay.

Test: TestSelfUpdateCleansTempDirAfterReplace runs a full update with a fake installer and replacer and checks that the temp dir is gone afterwards. go test ./internal/app/ passes.

Fixes #59

Update created an eget-self-update-* directory for every run and never
removed it, so they piled up in the temp dir (inherelab#59). Clean it up once the
replace has finished or failed. Keep it when the replace is deferred,
since the Windows helper script still moves the extracted binary after
eget exits.

Fixes inherelab#59
@inhere
inhere self-requested a review October 6, 2026 11:17
@inhere
inhere merged commit 973fd5e into inherelab:master Oct 6, 2026
6 checks passed
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.

Self update leaves temporary directories behind

2 participants