Skip to content

Commit

Permalink
Use greaterThanOrEqualTo instead of satisfies to compare latest and c…
Browse files Browse the repository at this point in the history
…urrent versions.
  • Loading branch information
kporras07 committed Feb 9, 2022
1 parent 48d3bfa commit ebbeece
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 @@ -4,6 +4,7 @@

use Composer\Semver\VersionParser;
use Composer\Semver\Semver;
use Composer\Semver\Comparator;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand Down Expand Up @@ -210,7 +211,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
'compatible' => $isCompatibleOptionSet,
'version_constraint' => $versionConstraintArg,
]);
if (null === $latestRelease || Semver::satisfies($latestRelease['version'], $this->currentVersion)) {
if (null === $latestRelease || Comparator::greaterThanOrEqualTo($this->currentVersion, $latestRelease['version'])) {
$output->writeln('No update available');
return 0;
}
Expand Down

0 comments on commit ebbeece

Please sign in to comment.