diff --git a/module/CLI/src/Command/Install/InstallCommand.php b/module/CLI/src/Command/Install/InstallCommand.php
index bb19514f..6df92f26 100644
--- a/module/CLI/src/Command/Install/InstallCommand.php
+++ b/module/CLI/src/Command/Install/InstallCommand.php
@@ -94,14 +94,33 @@ class InstallCommand extends Command
$output->writeln(['Custom configuration properly generated!', '']);
// Generate database
- $output->write('Initializing database...');
- $this->processHelper->run($output, 'php vendor/bin/doctrine.php orm:schema-tool:create');
- $output->writeln(' Success!');
+ $output->writeln('Initializing database...');
+ $process = $this->processHelper->run($output, 'php vendor/bin/doctrine.php orm:schema-tool:create');
+ if ($process->isSuccessful()) {
+ $output->writeln(' Success!');
+ } else {
+ if ($output->isVerbose()) {
+ return;
+ }
+ $output->writeln(
+ ' Error generating database. Run this command with -vvv to see specific error info.'
+ );
+ return;
+ }
// Generate proxies
- $output->write('Generating proxies...');
- $this->processHelper->run($output, 'php vendor/bin/doctrine.php orm:generate-proxies');
- $output->writeln(' Success!');
+ $output->writeln('Generating proxies...');
+ $process = $this->processHelper->run($output, 'php vendor/bin/doctrine.php orm:generate-proxies');
+ if ($process->isSuccessful()) {
+ $output->writeln(' Success!');
+ } else {
+ if ($output->isVerbose()) {
+ return;
+ }
+ $output->writeln(
+ ' Error generating proxies. Run this command with -vvv to see specific error info.'
+ );
+ }
}
protected function askDatabase()
diff --git a/module/CLI/test/Command/Install/InstallCommandTest.php b/module/CLI/test/Command/Install/InstallCommandTest.php
index 6fb2ee79..846a083b 100644
--- a/module/CLI/test/Command/Install/InstallCommandTest.php
+++ b/module/CLI/test/Command/Install/InstallCommandTest.php
@@ -8,6 +8,7 @@ use Shlinkio\Shlink\CLI\Command\Install\InstallCommand;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Helper\ProcessHelper;
use Symfony\Component\Console\Tester\CommandTester;
+use Symfony\Component\Process\Process;
use Zend\Config\Writer\WriterInterface;
class InstallCommandTest extends TestCase
@@ -23,10 +24,12 @@ class InstallCommandTest extends TestCase
public function setUp()
{
+ $processMock = $this->prophesize(Process::class);
+ $processMock->isSuccessful()->willReturn(true);
$processHelper = $this->prophesize(ProcessHelper::class);
$processHelper->getName()->willReturn('process');
$processHelper->setHelperSet(Argument::any())->willReturn(null);
- $processHelper->run(Argument::cetera())->willReturn(null);
+ $processHelper->run(Argument::cetera())->willReturn($processMock->reveal());
$app = new Application();
$helperSet = $app->getHelperSet();
diff --git a/phpcs.xml b/phpcs.xml
index 469dd989..5b686079 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -20,4 +20,5 @@
module
config
public/index.php
+ config/params/*