Skip to content

Commit

Permalink
Cli command check errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Fedik committed Aug 16, 2023
1 parent f8216ba commit 149e4e6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions libraries/src/Console/UpdateCoreCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
namespace Joomla\CMS\Console;

use Joomla\Application\Cli\CliInput;
use Joomla\CMS\Factory;
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
use Joomla\CMS\Installer\InstallerHelper;
Expand Down Expand Up @@ -132,6 +133,11 @@ private function configureIO(InputInterface $input, OutputInterface $output)

$this->cliInput = $input;
$this->ioStyle = new SymfonyStyle($input, $output);

$language = Factory::getLanguage();
$language->load('lib_joomla', JPATH_ADMINISTRATOR);
$language->load('', JPATH_ADMINISTRATOR);
$language->load('com_joomlaupdate', JPATH_ADMINISTRATOR);
}

/**
Expand Down Expand Up @@ -174,6 +180,12 @@ public function doExecute(InputInterface $input, OutputInterface $output): int

if ($this->updateJoomlaCore($model)) {
$this->progressBar->finish();

if ($model->getErrors()) {
$this->ioStyle->error('Update finished with errors. Please check logs for details.');
return self::ERR_UPDATE_FAILED;
}

$this->ioStyle->success('Joomla core updated successfully!');

return self::UPDATE_SUCCESSFUL;
Expand Down

0 comments on commit 149e4e6

Please sign in to comment.