fix(cli): install the latest CLI when the requested release does not exist
Problem
hosts add (Set up over SSH) asks the installer for the CLI release that matches the local CLI version. Desktop 2.0.3, 2.0.6 and 2.0.7 have no cli-v release (those Release CLI runs were cancelled), so setup from those versions stops on a 404.
Change
When the requested release has no tarball, install.sh warns and installs cli-latest. A failure on cli-latest still stops with an error. Released desktop builds fetch this script from the marketing site, so they get the fix without an update.
Tested
- linux-x64 (Ubuntu 22.04 container):
cli-v2.0.6falls back and installs 2.0.11;cli-v2.0.11andlatestinstall as before. - darwin-arm64:
cli-v2.0.6falls back and installs 2.0.11.
Summary by cubic
Fixes hosts add (Set up over SSH) failing with a 404 for desktop versions that have no matching CLI release. Desktop 2.0.3, 2.0.6, and 2.0.7 have no cli-v release. The installer now warns and falls back to installing cli-latest; a failure on cli-latest still stops with an error. Released desktop builds fetch this script from the marketing site, so they get the fix without an update.
Summary by CodeRabbit
- Bug Fixes
- The CLI installer now falls back to the latest release when a version-specific download fails. If the requested version is already the latest, or the fallback download also fails, installation exits with an error and removes temporary files.