Skip to content
This repository has been archived by the owner on Dec 14, 2024. It is now read-only.

Commit

Permalink
add some logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Glutamat42 committed Nov 8, 2023
1 parent fb3a8fc commit cdc3002
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions opt/adler/moodle/adler_setup/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@ function get_updated_release_info(string $github_repo, string $version, string $
$matchingReleases = array_filter($releases, function ($release) use ($version) {
return strpos($release['tag_name'], $version) === 0;
});
cli_writeln("Matching releases: " . json_encode($matchingReleases));

usort($matchingReleases, function ($a, $b) {
return version_compare($a['tag_name'], $b['tag_name'], '<=') ? 1 : -1;
});
cli_writeln("Sorted matching releases: " . json_encode($matchingReleases));

$latestRelease = reset($matchingReleases);
cli_writeln("Latest release: " . json_encode($latestRelease));

if ($old_version !== null && $latestRelease['tag_name'] === $old_version) {
return false;
Expand Down

0 comments on commit cdc3002

Please sign in to comment.