Skip to content

Commit

Permalink
Make crashpad executable
Browse files Browse the repository at this point in the history
  • Loading branch information
beganovich committed Nov 20, 2024
1 parent 468d6cf commit 340e877
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions src/Command/DownloadChromiumCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
use ZipArchive;
use Symfony\Component\Console\Attribute\AsCommand;

/**
* Command signature.
*
*/
/**
* Command signature.
*
*/
#[AsCommand(
name: 'download',
description: 'Downloads the chromium binary',
Expand Down Expand Up @@ -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.");
Expand Down Expand Up @@ -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);
}
}
}
}

0 comments on commit 340e877

Please sign in to comment.