From fd5174ee2d7adfb25d660d800b4b21ba3a603832 Mon Sep 17 00:00:00 2001 From: Omar Date: Thu, 18 Jan 2024 10:16:22 +0100 Subject: [PATCH] Refine break lines for 'drush updb' command --- src/UpdaterCommand.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/UpdaterCommand.php b/src/UpdaterCommand.php index 9320a13..c538cb4 100644 --- a/src/UpdaterCommand.php +++ b/src/UpdaterCommand.php @@ -132,7 +132,6 @@ protected function execute(InputInterface $input, OutputInterface $output) { $this->output->writeln(''); $this->printHeader1('3. Updating packages'); $this->updatePackages($this->packagesToUpdate); - $this->output->writeln(''); $this->printHeader1('4. Report'); $this->showUpdatedPackages(); @@ -161,7 +160,7 @@ protected function runDrushCommand(string $command, array $environments = []) { } foreach ($environments as $environment) { - $this->output->writeln(sprintf("Running drush %s on the \"%s\" environment:\n", $command, $environment)); + $this->output->writeln(sprintf("Running drush %s on the \"%s\" environment.", $command, $environment)); $this->runCommand(sprintf('drush %s %s', $environment, $command)); } } @@ -237,6 +236,7 @@ protected function printSummary() { protected function consolidateConfiguration() { $this->runDrushCommand('cr'); $this->runDrushCommand('cim -y'); + $this->output->writeln(''); foreach ($this->environments as $environment) { $this->output->writeln(sprintf('Consolidating %s environment', $environment)); @@ -254,10 +254,12 @@ protected function consolidateConfiguration() { $environment, $this->commitAuthor )); + $this->output->writeln(''); } $this->runDrushCommand('cr'); $this->runDrushCommand('cim -y'); + $this->output->writeln(''); } /** @@ -389,6 +391,7 @@ protected function updatePackage(string $package) { $this->runDrushCommand('cr'); $this->runDrushCommand('updb -y'); $this->runDrushCommand('cex -y'); + $this->output->writeln(''); $this->runCommand('git add config'); } catch (\Exception $e) { @@ -401,7 +404,7 @@ protected function updatePackage(string $package) { $updated_packages = trim($this->runCommand('composer-lock-diff')->getOutput()); if (!empty($updated_packages)) { $this->output->writeln("Updated packages:"); - $this->output->writeln($updated_packages); + $this->output->writeln("$updated_packages\n"); } $commit_message = $this->calculateModuleUpdateCommitMessage($package); @@ -584,7 +587,7 @@ protected function showUpdatedPackages() { $updated_packages = $this->runCommand('composer-lock-diff --from composer.drupalupdater.lock --to composer.lock')->getOutput(); if (!empty($updated_packages)) { $this->output->writeln( - $updated_packages, + trim($updated_packages), ); } else {