fixes for symfony4 #74 #81

This commit is contained in:
Kevin Papst
2018-01-12 21:07:20 +01:00
parent a87355695e
commit 4d7fe3d595
5 changed files with 101 additions and 57 deletions

View File

@@ -26,6 +26,21 @@ use Symfony\Component\Console\Style\SymfonyStyle;
class InstallCommand extends Command
{
/**
* @var string
*/
protected $rootDir;
/**
* RunCodeSnifferCommand constructor.
* @param string $projectDirectory
*/
public function __construct($projectDirectory)
{
$this->rootDir = realpath($projectDirectory);
parent::__construct();
}
/**
* @inheritdoc
*/
@@ -77,14 +92,22 @@ class InstallCommand extends Command
try {
$command = $this->getApplication()->find('avanzu:admin:fetch-vendor');
$command->run([], $output);
$command->run(new ArrayInput([]), $output);
} catch (\Exception $ex) {
$io->error('Failed to fetch vendors for avanzu-admin-theme: ' . $ex->getMessage());
return 3;
}
try {
$command = $this->getApplication()->find('avanzu:admin:initialize');
$command->run(new ArrayInput(array_merge(['--web-dir' => 'public'], $arguments)), $output);
$command->run(
new ArrayInput(
array_merge([
'--web-dir' => $this->rootDir . '/public',
'--vendor-dir' => $this->rootDir . '/vendor',
], $arguments)
),
$output
);
} catch (\Exception $ex) {
$io->error('Failed to initialize avanzu-admin-theme: ' . $ex->getMessage());
return 4;