Skip to content

Commit

Permalink
Merge pull request #18 from consolidation/no-download-if-current-greater
Browse files Browse the repository at this point in the history
No download if current version is greater than latest release.
  • Loading branch information
kporras07 authored Feb 9, 2022
2 parents 48d3bfa + ebbeece commit 8a64bdd
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 8a64bdd

Please sign in to comment.