Report only upgraded packages
This commit is contained in:
parent
f01871a0e8
commit
0003ada3ff
@ -82,18 +82,35 @@ function ___install_madeline()
|
|||||||
$phar = \file_get_contents(\sprintf($phar_template, $release_branch));
|
$phar = \file_get_contents(\sprintf($phar_template, $release_branch));
|
||||||
|
|
||||||
if ($phar) {
|
if ($phar) {
|
||||||
|
$extractVersions = static function () {
|
||||||
|
if (!file_exists('phar://madeline.phar/vendor/composer/installed.json')) {
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
$composer = \json_decode(\file_get_contents('phar://madeline.phar/vendor/composer/installed.json'), true);
|
||||||
|
$packages = array();
|
||||||
|
foreach ($composer as $dep) {
|
||||||
|
$packages[$dep['name']] = $dep['version_normalized'];
|
||||||
|
}
|
||||||
|
return $packages;
|
||||||
|
};
|
||||||
|
$previous = $extractVersions();
|
||||||
|
$previous['danog/madelineproto'] = 'old';
|
||||||
|
|
||||||
\file_put_contents('madeline.phar', $phar);
|
\file_put_contents('madeline.phar', $phar);
|
||||||
\file_put_contents('madeline.phar.version', $release);
|
\file_put_contents('madeline.phar.version', $release);
|
||||||
|
|
||||||
|
$current = $extractVersions();
|
||||||
$composer = \json_decode(\file_get_contents('phar://madeline.phar/vendor/composer/installed.json'), true);
|
$postData = array('downloads' => array());
|
||||||
$postData = ['downloads' => []];
|
foreach ($current as $name => $version) {
|
||||||
foreach ($composer as $dep) {
|
if (isset($previous[$name]) && $previous[$name] === $version) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$postData['downloads'][] = [
|
$postData['downloads'][] = [
|
||||||
'name' => $dep['name'],
|
'name' => $name,
|
||||||
'version' => $dep['version_normalized']
|
'version' => $version
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
$opts = ['http' =>
|
$opts = ['http' =>
|
||||||
[
|
[
|
||||||
'method' => 'POST',
|
'method' => 'POST',
|
||||||
|
Loading…
Reference in New Issue
Block a user