Skip to content

Commit

Permalink
Show all packages missing update on reports
Browse files Browse the repository at this point in the history
  • Loading branch information
omarlopesino committed May 5, 2023
1 parent 9d686b0 commit f9dd368
Showing 1 changed file with 32 additions and 14 deletions.
46 changes: 32 additions & 14 deletions src/UpdaterCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,12 @@ protected function execute(InputInterface $input, OutputInterface $output) {
$this->updatePackages($this->packagesToUpdate);
$this->output->writeln('');
$this->printHeader1('4. Report');
$this->report();
$this->showUpdatedPackages();

$this->showPendingUpdates();

$this->cleanup();

return 0;
}

Expand Down Expand Up @@ -409,24 +414,14 @@ protected function handlePackageUpdateErrors(\Exception $e) {
}

/**
* Shows a report.
*
* The report contains:
* - All the updated packages.
* - All the new packages (sub-dependencies).
* - Pending updates.
* Shows all the pending updates
*/
protected function report() {
$this->output->writeln(
$this->runCommand('composer-lock-diff --from composer.drupalupdater.lock --to composer.lock')->getOutput(),
);

$this->runCommand('rm composer.drupalupdater.lock');
protected function showPendingUpdates() {

if ($this->onlySecurity) {
$this->printHeader2('Not Updated Securities (Packagist):');
$this->output->writeln(
$this->runCommand('composer audit --locked $update_no_dev --format plain 2>&1 | grep ^Package | cut -f2 -d: | sort -u')->getOutput(),
$this->runCommand('composer audit --locked --format plain 2>&1 | grep ^Package | cut -f2 -d: | sort -u')->getOutput(),
);

$this->printHeader2('Not Updated Securities (Drupal):');
Expand All @@ -446,6 +441,13 @@ protected function report() {
$this->runCommand('composer show --locked --outdated --direct')->getOutput()
);

$this->output->writeln('');
$this->printHeader2('Not Updated Packages (ALL):');
$this->output->writeln(
$this->runCommand('composer show --locked --outdated')->getOutput()
);

$this->output->writeln('');
$this->printHeader2('Not Updated Securities (ALL):');
$this->output->writeln(
$this->runCommand('composer audit --locked')->getOutput()
Expand All @@ -458,6 +460,22 @@ protected function report() {
}
}

/**
* Show updated packages.
*/
protected function showUpdatedPackages() {
$this->output->writeln(
$this->runCommand('composer-lock-diff --from composer.drupalupdater.lock --to composer.lock')->getOutput(),
);
}

/**
* Cleanup the residual files.
*/
protected function cleanup() {
$this->runCommand('rm composer.drupalupdater.lock');
}

/**
* Checks that the package is a drupal extension.
*
Expand Down

0 comments on commit f9dd368

Please sign in to comment.