Skip to content

Commit

Permalink
Unsupported modules script helper now just prints a json so it parsed…
Browse files Browse the repository at this point in the history
… by the main script
  • Loading branch information
omarlopesino committed May 16, 2023
1 parent e69d3f6 commit 5133fe8
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions scripts/unsupported-modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
*/

use Drupal\update\UpdateManagerInterface;
use Symfony\Component\Console\Helper\Table;
use Drush\Drush;

$output = Drush::output();
$updateManager = \Drupal::service('update.manager');
$updateManager->refreshUpdateData();
$projectData = $updateManager->getProjects();
Expand All @@ -28,16 +25,14 @@
$recommended = $project['recommended'] != $project['existing_version'] ? $project['recommended'] : 'None';

return [
$project['name'],
$project['existing_version'],
$recommended,
'project_name' => $project['name'],
'current_version' => $project['existing_version'],
'recommended_version' => $recommended,
];
}, $projects);

$fixed_drupal_advisories_table = new Table($output);
$fixed_drupal_advisories_table->setHeaders(['Module', 'Current version', 'Recommended version']);
$fixed_drupal_advisories_table->setRows($projects_unsupported_data);
$fixed_drupal_advisories_table->render();
print json_encode($projects_unsupported_data);

}
else {
$output->writeln('This project does not contain obsolete modules.');
Expand Down

0 comments on commit 5133fe8

Please sign in to comment.