diff --git a/src/Command/DownloadChromiumCommand.php b/src/Command/DownloadChromiumCommand.php index d325413..e21d0d3 100644 --- a/src/Command/DownloadChromiumCommand.php +++ b/src/Command/DownloadChromiumCommand.php @@ -12,10 +12,10 @@ use ZipArchive; use Symfony\Component\Console\Attribute\AsCommand; - /** - * Command signature. - * - */ +/** + * Command signature. + * + */ #[AsCommand( name: 'download', description: 'Downloads the chromium binary', @@ -110,6 +110,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int chmod($this->generatePlatformExecutable($platformRevision), 0755); + $this->setCrashpadExecutable($platformRevision); + (new Filesystem())->remove(dirname(__FILE__, 3) . "/versions/{$platformRevision}.zip"); $output->writeln("Completed! {$platformRevision} currently in use."); @@ -175,4 +177,17 @@ public function generatePlatformExecutable(string $revision, int $level = 3): ?s return null; } + + public function setCrashpadExecutable(string $revision, int $level = 3): void + { + $platform = $this->generatePlatformCode(); + + if ($platform == 'Linux_x64') { + $path = dirname(__FILE__, $level) . "/versions/{$revision}/chrome-linux/chrome_crashpad_handler"; + + if (file_exists($path)) { + chmod($path, 0755); + } + } + } }