Skip to content

Commit

Permalink
Refine break lines for 'drush updb' command
Browse files Browse the repository at this point in the history
  • Loading branch information
omarlopesino committed Jan 18, 2024
1 parent f5fe146 commit fd5174e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/UpdaterCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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));
}
}
Expand Down Expand Up @@ -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));
Expand All @@ -254,10 +254,12 @@ protected function consolidateConfiguration() {
$environment,
$this->commitAuthor
));
$this->output->writeln('');
}

$this->runDrushCommand('cr');
$this->runDrushCommand('cim -y');
$this->output->writeln('');
}

/**
Expand Down Expand Up @@ -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) {
Expand All @@ -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);
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit fd5174e

Please sign in to comment.