Skip to content

Commit ca6748c

Browse files
authored
Sort resources/all-versions.json (#42)
1 parent 049bccf commit ca6748c

2 files changed

Lines changed: 423 additions & 423 deletions

File tree

bin/update-all-versions

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
declare(strict_types=1);
55

6+
use Composer\Semver\Semver;
67
use TypistTech\PhpMatrix\Releases\PhpNetReleases;
78

89
include $_composer_autoload_path ?? __DIR__ . '/../vendor/autoload.php';
910

10-
define('ALL_VERSIONS_FILE', __DIR__ . '/../resources/all-versions.json');
11-
1211
$releases = new PhpNetReleases;
1312
$data = $releases->all();
13+
$data = Semver::rsort($data);
1414

1515
$content = json_encode($data, JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
16-
file_put_contents(ALL_VERSIONS_FILE, $content);
16+
file_put_contents(__DIR__ . '/../resources/all-versions.json', $content);

0 commit comments

Comments
 (0)