Skip to content

Commit

Permalink
Output formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
andrerom committed Feb 18, 2019
1 parent 5d56685 commit 6e5b264
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions bundle/Command/LegacyInitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->enableRoutes($output);

$output->writeln(<<<'EOT'
All steps completed.
<options=bold,underscore>All steps completed!</options>
You can now check changes done and start to move over any legacy files (see above).
Expand Down Expand Up @@ -100,7 +101,7 @@ protected function updateComposeJson(OutputInterface $output)
$updateComposerJson = false;
$composerJson = json_decode(file_get_contents('composer.json'), true);
if ($composerJson === null) {
$errOutput->writeln('Error: Unable to parse composer.json');
$errOutput->writeln('<error>Error: Unable to parse composer.json</error>');

return;
}
Expand All @@ -120,10 +121,11 @@ protected function updateComposeJson(OutputInterface $output)
$composerJson['scripts']['symfony-scripts'] = ['@legacy-scripts'];
$updateComposerJson = true;
$errOutput->writeln(<<<'EOT'
Warning : Did not find a <info>symfony-scripts</info> section in composer.json, check
source from eZ for how this is used and adapt your composer.json to take advantage.
<error>Warning : Did not find a <info>symfony-scripts</info> section in composer.json, check
source from eZ for how this is used and adapt your composer.json to take advantage.</error>
Example for stock 2.x setup:
<info>
"scripts": {
"legacy-scripts": [
"eZ\\Bundle\\EzPublishLegacyBundle\\Composer\\ScriptHandler::installAssets",
Expand All @@ -145,7 +147,7 @@ protected function updateComposeJson(OutputInterface $output)
"post-update-cmd": [
"@symfony-scripts"
],
(...)
</info>
EOT
);
} elseif (!\in_array('@legacy-scripts', $composerJson['scripts']['symfony-scripts'])) {
Expand Down Expand Up @@ -176,7 +178,7 @@ protected function enableBundles(OutputInterface $output)
{
$errOutput = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output;
if (!$text = file_get_contents('app/AppKernel.php')) {
$errOutput->writeln('Error: Unable to load app/AppKernel.php');
$errOutput->writeln('<error>Error: Unable to load app/AppKernel.php</error>');

return;
}
Expand All @@ -197,7 +199,7 @@ protected function enableBundles(OutputInterface $output)
}

if (!$appOffset) {
$errOutput->writeln('Error: Could not find "new AppBundle\AppBundle()" in app/AppKernel.php');
$errOutput->writeln('<error>Error: Could not find "new AppBundle\AppBundle()" in app/AppKernel.php</error>');

return;
}
Expand All @@ -223,7 +225,7 @@ protected function enableRoutes(OutputInterface $output)
{
$errOutput = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output;
if (!$text = file_get_contents('app/config/routing.yml')) {
$errOutput->writeln('Error: Unable to load app/config/routing.yml');
$errOutput->writeln('<error>Error: Unable to load app/config/routing.yml</error>');

return;
}
Expand Down

0 comments on commit 6e5b264

Please sign in to comment.