Skip to content

Commit

Permalink
[TASK] Improve CLI output
Browse files Browse the repository at this point in the history
  • Loading branch information
kitzberger authored and achimfritz committed Aug 1, 2024
1 parent 9e4003a commit 36e628f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
17 changes: 11 additions & 6 deletions Classes/Command/SortingCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,17 @@ public function execute(InputInterface $input, OutputInterface $output): int
$input->getOption('enable-logging'),
$pid
);
foreach ($errors as $error) {
$output->writeln($error);
}
if (empty($errors)) {
$output->writeln('migration finished');

if ($output->isVerbose()) {
$output->writeln('Checking ' . ($pid > 0 ? 'page ' . $pid : 'entire pagetree') . ($dryrun ? ' [DRYRUN]' : ''));
foreach ($errors as $error) {
$output->writeln($error);
}
if (empty($errors)) {
$output->writeln('- all good, nothing to do here');
}
}
return 0;

return self::SUCCESS;
}
}
2 changes: 1 addition & 1 deletion Classes/Integrity/Sorting.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ protected function fixChildrenSortingUpdateRequired(Container $container, array
$children = $container->getChildrenByColPos($colPos);
foreach ($children as $child) {
if ($child['sorting'] <= $prevSorting) {
$this->errors[] = 'container uid: ' . $containerRecord['uid'] . ', pid ' . $containerRecord['pid'] . ' must be fixed';
$this->errors[] = '- pid ' . $containerRecord['pid'] . ', container uid ' . $containerRecord['uid'] . ' must be fixed';
return true;
}
$prevSorting = $child['sorting'];
Expand Down

0 comments on commit 36e628f

Please sign in to comment.