Skip to content

fix: keep the working CLI when a release update fails - #53

Open
Arthurvroum wants to merge 1 commit into
mainfrom
38-safe-cli-update
Open

Arthurvroum wants to merge 1 commit into
mainfrom
38-safe-cli-update

Conversation

@Arthurvroum

Copy link
Copy Markdown
Collaborator

The updater deleted and replaced bin, lib, config and libexec one at a time, then looked for the new CLI in the live folder. An archive without a CLI displaced a working one, and a failed rename could pair new binaries with old libraries.

  • The staged release is checked before anything is touched: without a CLI, the installed version stays as it is.
  • The installed folders are moved aside, the staged ones moved in, and on any failure the new ones are removed and the old ones put back. The old copy is deleted only once the new layout is complete.
  • At startup, an update interrupted in between is rolled back, or its leftover copy deleted when the new release is complete.
  • The stored version is only updated after a successful install, as before.

Fixes #38

The updater deleted and replaced bin, lib, config and libexec one at a
time, then looked for the new CLI in the live folder. An archive without a
CLI displaced a working one, and a failed rename could pair new binaries
with old libraries.

- The staged release is checked before anything is touched: without a
  CLI, the installed version stays as it is.
- The installed folders are moved aside, the staged ones moved in, and on
  any failure the new ones are removed and the old ones put back. The old
  copy is deleted only once the new layout is complete.
- At startup, an update interrupted in between is rolled back, or its
  leftover copy deleted when the new release is complete.
- The stored version is only updated after a successful install, as before.

Fixes #38
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.

Preserve the working CLI installation if a release update fails

1 participant