Commit f05252c
authored
fix: prune leftover update artifacts from the bin dir before updating (#41)
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.1 parent 25ab866 commit f05252c
1 file changed
Lines changed: 21 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
153 | 173 | | |
154 | 174 | | |
155 | 175 | | |
| |||
0 commit comments