Skip to content

Commit

Permalink
fix: Fix updates when requesting beta versions
Browse files Browse the repository at this point in the history
  • Loading branch information
stmh committed Aug 16, 2022
1 parent 4b0e5ed commit 9a5c269
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Command/SelfUpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,16 @@ public function hasUpdate($allow_unstable = false)
$updater = $stable_updater;
if ($use_unstable) {
$unstable_updater = self::getUpdater($this->getApplication(), true);
$unstable_updater->hasUpdate(); // fetch version from github
$stable_updater->hasUpdate(); // fetch version from github
$unstable_version = $unstable_updater->getNewVersion();
$stable_version = $stable_updater->getNewVersion();
// Using an unstable version doesn't make sense if the latest
// version is greater than the latest unstable version.
// Hence, we try to update to unstable version
// if and only if stable version is less than unstable version.
if (Comparator::lessThan($stable_version, $unstable_version)) {
$updater = $unstable_version;
$updater = $unstable_updater;
}
}
if (!$updater->hasUpdate()) {
Expand Down

0 comments on commit 9a5c269

Please sign in to comment.