fix: report Unix update download failures
wally update can exit successfully on macOS and Linux even when downloading the installer fails. The curl | sh pipeline reports the shell's exit code, so an empty download can look like a successful update. A partial download can also run before curl reports the error.
This change downloads the whole script first and only runs it if curl succeeds. The background update check uses the same approach, so a failed download cannot replace the cached version.
I added 20 end-to-end checks for the built CLI using a local server. They cover failed and partial downloads, installer failures, and background checks without changing an existing installation.
Formatting, Python syntax and consistency checks pass locally, and the shell checks reproduce the original problem and confirm the changed commands behave as expected. macOS and Linux CI are still running, so this stays in draft until the native checks finish.
Summary by cubic
Fixes Unix wally update so a failed installer download exits with failure instead of executing an incomplete response, and now falls back to a usable temporary directory when TMPDIR is missing or not a directory, so background version-refresh checks still complete.
- Downloads the full installer to a private temp file and runs it only after curl finishes (foreground and background refresh).
- Locks temp files with traps so failed or interrupted downloads never leak or execute.
- Falls back to
/tmpwhenTMPDIRis unusable and passes that directory to the installer, preserving cached version checks. - Adds 20 end-to-end checks covering download, partial-response, installer, background-refresh, and unusable-
TMPDIRcases; macOS and Linux CI now run them.
Summary by CodeRabbit
- Bug Fixes
- Unix updates now download the complete installer before running it, apply configured timeouts to downloads, and remove temporary installer files after use.
- Background update checks now replace cached results only when the check succeeds and returns nonempty output.
- Tests
- Added automated macOS and Linux coverage for update commands, download and installer failures, background refresh and cache behavior, and temporary-directory fallback.