Skip to content

Commit

Permalink
TASK: Improve flow cr:status
Browse files Browse the repository at this point in the history
Followup to neos/neos-development-collection#4846

- require a $details string for all non-ok status
- print "No details available." if verbose and non-ok and no details are available
- dont wortbreak details in verbose mode but print them with indentation of 2 full line per line
- print new line after printing details
- add details to AssetUsageProjection's setupRequired
  • Loading branch information
mhsdesign committed Jan 23, 2024
1 parent 9f49dc7 commit 181709b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Classes/Command/CrCommandController.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,12 @@ public function statusCommand(string $contentRepository = 'default', bool $verbo
if ($projectionStatus->type !== ProjectionStatusType::OK) {
$hasErrorsOrWarnings = true;
}
if ($verbose && $projectionStatus->details !== '') {
$this->outputFormatted($projectionStatus->details, [], 2);
if ($verbose && ($projectionStatus->type !== ProjectionStatusType::OK || $projectionStatus->details)) {
$lines = explode(chr(10), $projectionStatus->details ?: '<comment>No details available.</comment>');
foreach ($lines as $line) {
$this->outputLine(' ' . $line);
}
$this->outputLine();
}
}
if ($hasErrorsOrWarnings) {
Expand Down

0 comments on commit 181709b

Please sign in to comment.