Skip to content

Commit

Permalink
Merge pull request #1092 from M0rgan01/improve-altered-files-command
Browse files Browse the repository at this point in the history
[CLI] Add conditions for empty altered files in command
  • Loading branch information
Quetzacoalt91 authored Dec 20, 2024
2 parents faee9bf + 29261b8 commit 02b96dd
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions classes/Commands/CheckRequirementsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,31 +162,39 @@ private function processRequirementWarnings(): void
case UpgradeSelfCheck::CORE_TEMPERED_FILES_LIST_NOT_EMPTY:
$missingFiles = $this->upgradeSelfCheck->getCoreMissingFiles();

$this->output->writeln("\t" . count($missingFiles) . ' files are missing:');
foreach ($missingFiles as $missingFile) {
$this->output->writeln("\t\t" . $missingFile);
if (!empty($missingFiles)) {
$this->output->writeln("\t" . count($missingFiles) . ' files are missing:');
foreach ($missingFiles as $missingFile) {
$this->output->writeln("\t\t" . $missingFile);
}
}

$alteredFiles = $this->upgradeSelfCheck->getCoreAlteredFiles();

$this->output->writeln("\t" . count($alteredFiles) . ' files are altered:');
foreach ($alteredFiles as $alteredFile) {
$this->output->writeln("\t\t" . $alteredFile);
if (!empty($alteredFiles)) {
$this->output->writeln("\t" . count($alteredFiles) . ' files are altered:');
foreach ($alteredFiles as $alteredFile) {
$this->output->writeln("\t\t" . $alteredFile);
}
}
break;
case UpgradeSelfCheck::THEME_TEMPERED_FILES_LIST_NOT_EMPTY:
$missingFiles = $this->upgradeSelfCheck->getThemeMissingFiles();

$this->output->writeln("\t" . count($missingFiles) . ' files are missing:');
foreach ($missingFiles as $missingFile) {
$this->output->writeln("\t\t" . $missingFile);
if (!empty($missingFiles)) {
$this->output->writeln("\t" . count($missingFiles) . ' files are missing:');
foreach ($missingFiles as $missingFile) {
$this->output->writeln("\t\t" . $missingFile);
}
}

$alteredFiles = $this->upgradeSelfCheck->getThemeAlteredFiles();

$this->output->writeln("\t" . count($alteredFiles) . ' files are altered:');
foreach ($alteredFiles as $alteredFile) {
$this->output->writeln("\t\t" . $alteredFile);
if (!empty($alteredFiles)) {
$this->output->writeln("\t" . count($alteredFiles) . ' files are altered:');
foreach ($alteredFiles as $alteredFile) {
$this->output->writeln("\t\t" . $alteredFile);
}
}
break;
default:
Expand Down

0 comments on commit 02b96dd

Please sign in to comment.