-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support pre-release versions in
self-update
command (#4022)
* perf: got rid of unnecessary HTTP requests This improves performance by avoiding unnecessary target version searches when the version is specified explicitly. Also, this removes the unnecessary local variable `targetVersion` which has been semantically equal to `desiredVersion`. * refactor: utility function to find a release by a predicate The new method `findReleaseVersion` contains machinery to traverse GitHub releases in a pagination mode and get the first one matching a given predicate. * refactor: move GH helpers to a dedicated namespace To reduce the semantic load of the `SelfUpdateCommand` class. Those helpers are generic and not tightly related to the semantics of the `self-update` command. * refactor: inline `targetVersionMatches` method That method was tightly connected to the caller's logic, and was used by the only caller. * refactor: helper function to get release artifact details To isolate the artifacts details collection and return the details as a structured object. The artifacts details can differ depending on the `desiredVersion` type (edge/pre-release/release). This change will support pre-prelease versions in `self-update` command. * refactor: helper function to identify pre-release versions * feat: support pre-release versions in `self-update` command * chore: remove unnecessary log line An empty message on the `error` level gets rendered as `✖ undefined`. That might be not very clear. * fix: fix version comparing logic To correctly handle `0.x` -> `0.y` updates as major ones. --------- Co-authored-by: Orzelius <[email protected]>
- Loading branch information
1 parent
d276130
commit 91179f1
Showing
3 changed files
with
297 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.