Skip to content

Commit

Permalink
Add proper error handling for public folder cli installation (#42168)
Browse files Browse the repository at this point in the history
Co-authored-by: Quy <[email protected]>
  • Loading branch information
HLeithner and Quy authored Oct 20, 2023
1 parent ddbce21 commit 4c799de
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion installation/src/Console/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ protected function doExecute(InputInterface $input, OutputInterface $output): in
$cleanupModel = $app->getMVCFactory()->createModel('Cleanup', 'Installation');

if (!$cleanupModel->deleteInstallationFolder()) {
$this->ioStyle->error('Unable to delete installation folder!');

return Command::FAILURE;
}

Expand All @@ -184,7 +186,11 @@ protected function doExecute(InputInterface $input, OutputInterface $output): in
if (!empty($cfg['public_folder'])) {
$this->ioStyle->write('Creating the public folder...');

if (!(new PublicFolderGeneratorHelper())->createPublicFolder($cfg['public_folder'])) {
try {
(new PublicFolderGeneratorHelper())->createPublicFolder($cfg['public_folder']);
} catch (\Exception $e) {
$this->ioStyle->error($e->getMessage());

return Command::FAILURE;
}

Expand Down

0 comments on commit 4c799de

Please sign in to comment.