Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CMSP-881] use version_compare #120

Merged
merged 2 commits into from
Mar 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Cli/FrameworkCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function cliCosUpdate($cli = 'wp')
$versions_file_path = "$work_dir/wpcli/Dockerfile";
$version_file_contents = file_get_contents($versions_file_path);
$version = $this->getCosWpCliVersion($version_file_contents);

$updated_version = '';
$next_version = $this->nextWpVersionThatExists($version);
if (!$next_version) {
Expand Down Expand Up @@ -299,7 +299,7 @@ protected function nextWpVersionThatExists($current_version)

// If our versions do not match, check that the latest version exists before continuing.
// Greater than comparision to ensure that we don't get older versions. See https://github.com/pantheon-systems/cos-framework-clis/pull/76#issuecomment-1118650316
if ($latest_version > $current_version) {
if (version_compare($latest_version, $current_version, '>')) {
$try_version = $this->wpVersionExists($latest_version);

if (!empty($try_version)) {
Expand Down
Loading