Skip to content

Commit

Permalink
Merge pull request #19 from grasmash/prerelease
Browse files Browse the repository at this point in the history
Consider prereleases to be unstable.
  • Loading branch information
grasmash authored Jun 16, 2022
2 parents 8a64bdd + ad6bb48 commit 735ea26
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/SelfUpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ protected function getReleasesFromGithub()
$parsed_releases[$normalized] = [
'tag_name' => $normalized,
'assets' => $release->assets,
'prerelease' => $release->prerelease,
];
}
$sorted_versions = Semver::rsort(array_keys($parsed_releases));
Expand Down Expand Up @@ -149,7 +150,7 @@ public function getLatestReleaseFromGithub(array $options)
continue;
}

if (!$options['preview'] && VersionParser::parseStability($releaseVersion) !== 'stable') {
if (!$options['preview'] && (VersionParser::parseStability($releaseVersion) !== 'stable') || $release['prerelease']) {
// If preview not requested and current version is not stable, look for the next one.
continue;
}
Expand Down

0 comments on commit 735ea26

Please sign in to comment.