Skip to content

Commit

Permalink
Merge pull request #55 from huangzhhui/fix-version-validate
Browse files Browse the repository at this point in the history
Fix version validate error when the latest version is not a numeric
  • Loading branch information
huangzhhui authored Oct 11, 2022
2 parents b8b1e9c + f9a7b04 commit ea6c845
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app/DownloadHandler/AbstractDownloadHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ protected function latestVersionCheck(string $currentVersion, Definition $defini
return;
}
$latestVersion = $this->versions($definition->getPkgName())[0] ?? '';
// Trim v prefix
$latestVersion = ltrim($latestVersion, 'v');
if ($latestVersion && version_compare($currentVersion, $latestVersion, '>=')) {
throw new BoxException(sprintf('Your %s version %s is latest, no need to update, add `--reinstall` or `-r` option to force reinstall the package.', $definition->getPkgName(), $currentVersion));
}
Expand Down

0 comments on commit ea6c845

Please sign in to comment.